[llvm] [PPC] Lower unreachable IR instruction to a trap. (PR #101379)

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 4 23:36:36 PDT 2024


================
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=powerpc64-unknown-unknown %s -o - | FileCheck %s
+; RUN: llc -ppc-disable-trap-on-unreachable -mtriple=powerpc64-unknown-unknown %s -o - | FileCheck %s
----------------
chenzheng1030 wrote:

I think the expected output changing is "big" after this patch. For example, with option `-trap-unreachable=true -no-trap-after-noreturn=true`, I get:
```
.Lfunc_begin0:
    .cfi_startproc
# %bb.0:                                # %entry
    lhz 4, 2(0)
    trap
    cmplw   4, 3
```

But I believe the test point is still there in the changed output. This case checks `lhz 4, 2(0)` actually. So only if this load instruction is kept, I think it is fine we just change the case according to this patch.

I'll let @mandlebug make the final decision.

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


More information about the llvm-commits mailing list