[Mlir-commits] [mlir] [mlir][affine] Modify assertion into a user visible diagnostic (PR #136474)

Prakhar Dixit llvmlistbot at llvm.org
Tue Apr 22 04:38:22 PDT 2025


================
@@ -1262,6 +1277,21 @@ static Operation *vectorizeAffineStore(AffineStoreOp storeOp,
   else
     indices.append(mapOperands.begin(), mapOperands.end());
 
+  for (auto &kvp : state.vecLoopToVecDim) {
+    AffineForOp forOp = cast<AffineForOp>(kvp.first);
+    auto invariants =
+        affine::getInvariantAccesses(forOp.getInductionVar(), indices);
+    unsigned nonInvariant = 0;
+    for (Value idx : indices)
+      if (!invariants.count(idx))
+        ++nonInvariant;
+    if (nonInvariant > 1) {
+      LLVM_DEBUG(dbgs() << "\n[early-vect] Bail out: loop IV "
+                        << forOp.getInductionVar() << " drives " << nonInvariant
+                        << " indices (must be ≤1)\n");
+      return nullptr;
+    }
+  }
----------------
Prakhar-Dixit wrote:

Yeah sure !

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


More information about the Mlir-commits mailing list