[llvm] [InstCombine] Fold `trunc nuw (x xor y) to i1` to `x != y` (PR #90408)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 02:08:32 PDT 2024


================
@@ -770,6 +770,12 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) {
         return new ICmpInst(ICmpInst::Predicate::ICMP_EQ, X, Zero);
       }
     }
+
+    if (Trunc.hasNoUnsignedWrap()) {
----------------
vfdff wrote:

It also fine for nsw, https://alive2.llvm.org/ce/z/5fB_u9

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


More information about the llvm-commits mailing list