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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 05:08:18 PST 2022


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5885
 
+/// This function folds patterns produced by lowering of redice idioms, such as
+/// llvm.vector.reduce.and which are lowered into instruction chains. This code
----------------



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5887
+/// llvm.vector.reduce.and which are lowered into instruction chains. This code
+/// attempts to fewer number of scalar comparisons instead of vector
+/// comparisons when possible.
----------------



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5907
+        OpTy->getNumElements() * LHSTy->getElementType()->getIntegerBitWidth();
+    if (DL.isLegalInteger(NumBits)) {
+      auto *ScalarTy = Builder.getIntNTy(NumBits);
----------------
mkazantsev wrote:
> lebedev.ri wrote:
> > I suspect this should be relaxed to something like "is less than a legal integer"
> I'm not sure what happens if smth like `i63` lives through the pipeline to codegen. Is it ok?
Not sure, but at least something like "is a power of two that is smaller than the largest legal integer" should be fine.


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

https://reviews.llvm.org/D118317



More information about the llvm-commits mailing list