[Hexagon] Use trap0(#0xDB) for debugtrap instead of brkpt (#189446)

The brkpt instruction is intended for the in-silicon debugger (ISDB).
When ISDB is not enabled, brkpt is treated as a NOP, so
__builtin_debugtrap() would silently do nothing in user-mode Linux
processes.

Use trap0(#0xDB) instead.
This commit is contained in:
Brian Cain 2026-04-03 15:12:49 -05:00 committed by GitHub
parent 6476619f30
commit efdbf7b815
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -3461,7 +3461,7 @@ def HexagonBARRIER: SDNode<"HexagonISD::BARRIER", SDTNone, [SDNPHasChain]>;
def: Pat<(HexagonBARRIER), (Y2_barrier)>;
def: Pat<(trap), (PS_crash)>;
def: Pat<(debugtrap), (Y2_break)>;
def: Pat<(debugtrap), (J2_trap0 0xDB)>;
// Read cycle counter.
def : Pat<(i64 (readcyclecounter)), (PS_readcr64 UPCYCLE)>;

View File

@ -14,7 +14,7 @@ entry:
}
; CHECK-LABEL: f1
; CHECK: brkpt
; CHECK: trap0(#219)
define i32 @f1() noreturn nounwind {
entry:
tail call void @llvm.debugtrap()