[llvm] [WIP] [CodeGen] Enable TrapUnreachable by default for all targets. (PR #109732)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 05:01:25 PDT 2024


================
@@ -612,6 +614,10 @@ AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, const Triple &TT,
                         FS, Options, getEffectiveRelocModel(RM),
                         getEffectiveCodeModel(CM, CodeModel::Small), OptLevel),
       TLOF(createTLOF(getTargetTriple())) {
+  // FIXME: There are some scenarios where targets may not have hardware traps,
+  // and external calls to `abort` also fail. For now, do a blanket-disable.
+  if (!EnableTrapUnreachable.getNumOccurrences())
+    this->Options.TrapUnreachable = false;
----------------
arsenm wrote:

Targets should not have to flip bits in this setting like this 

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


More information about the llvm-commits mailing list