[llvm] [InstCombine] Drop samesign in `foldLogOpOfMaskedICmps` (PR #125829)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 18:00:58 PST 2025


================
@@ -610,8 +610,11 @@ static Value *foldLogOpOfMaskedICmps(Value *LHS, Value *RHS, bool IsAnd,
       APInt NewMask = *ConstB & *ConstD;
       if (NewMask == *ConstB)
         return LHS;
-      if (NewMask == *ConstD)
+      if (NewMask == *ConstD) {
+        if (IsLogical)
+          cast<ICmpInst>(RHS)->setSameSign(false);
----------------
dtcxzyw wrote:

Do you mean `trunc X to i1`?


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


More information about the llvm-commits mailing list