[llvm] [InstCombine] Add missing patterns for scmp and ucmp (PR #149225)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 18 03:26:08 PDT 2025
================
@@ -3757,6 +3757,10 @@ static Instruction *foldBitCeil(SelectInst &SI, IRBuilderBase &Builder,
// (x < y) ? -1 : zext(x > y)
// (x > y) ? 1 : sext(x != y)
// (x > y) ? 1 : sext(x < y)
+// (x == y) ? 0 : (x > y ? 1 : -1)
----------------
dtcxzyw wrote:
Can you please add some commuted tests?
```
(x != y) ? (x > y ? 1 : -1) : 0
x != C ? (x > C - 1 ? 1 : -1) : 0
```
https://github.com/llvm/llvm-project/pull/149225
More information about the llvm-commits
mailing list