[llvm] [LV] Use shl for (VFxUF * vscale) when creating minimum iter check. (PR #153495)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 14 02:43:58 PDT 2025


================
@@ -824,7 +824,13 @@ namespace llvm {
 Value *createStepForVF(IRBuilderBase &B, Type *Ty, ElementCount VF,
                        int64_t Step) {
   assert(Ty->isIntegerTy() && "Expected an integer step");
-  return B.CreateElementCount(Ty, VF.multiplyCoefficientBy(Step));
+  if (!VF.isScalable() || !isPowerOf2_64(VF.getKnownMinValue()) ||
----------------
david-arm wrote:

nit: Do we need the check for `isPowerOf2_64(VF.getKnownMinValue())`? I thought the vectoriser rejected non-power-of-2 VFs? I just wonder if this can be an assert instead.

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


More information about the llvm-commits mailing list