[llvm] [InstCombine] Add Missed Optimization (PR #141962)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 15 06:47:19 PDT 2025


https://github.com/dtcxzyw requested changes to this pull request.

Miscompilation reproducer: https://alive2.llvm.org/ce/z/yaCs4R
```
define i1 @src(i32 %0, i32 %1) {
common.ret:
  %2 = xor i32 %0, -1
  %3 = icmp sle i32 %1, %2
  %4 = xor i32 %1, -1
  %5 = icmp ugt i32 %0, %4
  %common.ret.op = and i1 %3, %5
  ret i1 %common.ret.op
}

define i1 @tgt(i32 %0, i32 %1) {
common.ret:
  ret i1 false
}
```

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


More information about the llvm-commits mailing list