[llvm] [InstCombine] Fold xored one-complemented operand comparisons (PR #69882)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 22 08:24:16 PDT 2023
================
@@ -4,6 +4,118 @@
declare void @llvm.assume(i1)
declare void @barrier()
+define i32 @test_slt_xor(i32 %0, i32 %1) {
----------------
dtcxzyw wrote:
`zext` is unnecessary.
```
define i1 @test_slt_xor(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = xor i32 %3, %1
%5 = icmp slt i32 %4, %3
ret i1 %5
}
```
https://github.com/llvm/llvm-project/pull/69882
More information about the llvm-commits
mailing list