[llvm] [X86] Trap instructions don't need side effects (PR #171552)
Harald van Dijk via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 11 02:59:13 PST 2025
hvdijk wrote:
> We use `hasUnmodeledSideEffects` to prevent MIR optimizations.
Yes, when the instructions' effects are not fully modelled. But in this case, the effect is fully modelled and `hasSideEffects = 1` was just set because this instruction predates `isTrap` (see https://github.com/llvm/llvm-project/commit/adc688ce9c2034a0fc5a094d61b76f356123a927). If any pass starts removing `isTrap = 1` instructions, or starts inappropriately re-ordering them, I believe that would be a bug in that pass, and I did not see any evidence of such a bug when I did some quick tests.
https://github.com/llvm/llvm-project/pull/171552
More information about the llvm-commits
mailing list