[PATCH] D118317: [InstCombine] Fold and-reduce idiom

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 09:07:48 PST 2022


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

The legality check probably needs refinement, but other than that this seems fine to me.
@spatel ?



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5922
+  ///   %all_eq = icmp eq i64 %lhs.scalar, %rhs.scalar
+  if (Constant->isZero() && InnerICmp->getPredicate() == ICmpInst::ICMP_NE) {
+    auto *ScalarTy = Builder.getIntNTy(NumBits);
----------------
I'm guessing you are expecting to handle other patterns?
Otherwise, early-return.


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

https://reviews.llvm.org/D118317



More information about the llvm-commits mailing list