[llvm] Revert "[SimplifyCFG] Deduce paths unreachable if they cause div/rem UB" (PR #137741)
Bill Wendling via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 28 18:49:37 PDT 2025
bwendling wrote:
> > Whether we generate a __builtin_trap or simply allow the calculation to happen is fine by me, but what we shouldn't do is generate broken code simply because it's UB.
>
> Is `--trap-unreachable` helpful for your case? TBH it is still unreliable since the optimizer may remove the whole BB and turn a conditional branch into an unconditional one.
It helps some, but causes other issues. From the Linux objtool:
```
panic() missing __noreturn in .c/.h or NORETURN() in noreturns.h
```
https://github.com/llvm/llvm-project/pull/137741
More information about the llvm-commits
mailing list