[Mlir-commits] [mlir] [mlir][affine] Modify assertion into a user visible diagnostic (PR #136474)
Mehdi Amini
llvmlistbot at llvm.org
Tue Apr 22 04:29:38 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;
+ }
+ }
----------------
joker-eph wrote:
Seems like code duplication here and above? Can you extract this in a helper function?
https://github.com/llvm/llvm-project/pull/136474
More information about the Mlir-commits
mailing list