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

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 05:03:13 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;
----------------
duk-37 wrote:

This is already happening all over the place though. See PS4, PS5, WASM, X86, AArch64, etc.

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


More information about the llvm-commits mailing list