[llvm] [BOLT] Don't terminate on trap instruction for Linux kernel (PR #87021)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 16:41:04 PDT 2024


================
@@ -121,6 +130,11 @@ bool MCPlusBuilder::equals(const MCTargetExpr &A, const MCTargetExpr &B,
   llvm_unreachable("target-specific expressions are unsupported");
 }
 
+bool MCPlusBuilder::isTerminator(const MCInst &Inst) const {
+  return Analysis->isTerminator(Inst) ||
+         (opts::TerminalTrap && Info->get(Inst.getOpcode()).isTrap());
----------------
maksfb wrote:

@yota9 The new code makes `brk 0x3e8` Arm instruction a basic block terminator. If it's not the desired behavior, we can turn off `--terminal-trap` on Arm.

https://github.com/llvm/llvm-project/pull/87021


More information about the llvm-commits mailing list