[PATCH] D140666: [InstCombine] combine intersection for inequality icmps

Yingchi Long via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 23:47:16 PST 2023


inclyc added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:663
 
-    Value *NewOr1 = Builder.CreateOr(B, D);
-    Value *NewAnd = Builder.CreateAnd(A, NewOr1);
-    Constant *NewOr2 = ConstantInt::get(A->getType(), ConstC | ConstE);
-    return Builder.CreateICmp(NewCC, NewAnd, NewOr2);
-  }
+      if (IsNot && !ConstB->isSubsetOf(*ConstD) && !ConstD->isSubsetOf(*ConstB))
+        return nullptr;
----------------
spatel wrote:
> Is there a negative test for this condition? Add a "negative test" comment if it is already here. Otherwise, can we add it?
Yes. See @masked_icmps_bmask_notmixed_not_subset_notoptimized in D142090. "not subset" refers to this condition


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140666/new/

https://reviews.llvm.org/D140666



More information about the llvm-commits mailing list