[PATCH] D125235: [LoopVectorize] Add overflow checks when tail-folding with scalable vectors

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 13 03:04:41 PDT 2022


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2985
+    // Get the maximum unsigned value for the type.
+    Value *LHS = ConstantInt::get(
+        Count->getType(), cast<IntegerType>(Count->getType())->getMask());
----------------
nit: `MaxUIntTripCount` ?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2987
+        Count->getType(), cast<IntegerType>(Count->getType())->getMask());
+    LHS = Builder.CreateSub(LHS, Count);
+
----------------
If you change the name of 'LHS' above, then you could propagate this into the ICmp expression below


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

https://reviews.llvm.org/D125235



More information about the llvm-commits mailing list