[Mlir-commits] [mlir] [MLIR][Affine] Add test pass for affine isContiguousAccess (PR #82923)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Tue Feb 27 05:19:06 PST 2024


================
@@ -344,10 +333,12 @@ bool mlir::affine::isVectorizableLoopBody(
     auto load = dyn_cast<AffineLoadOp>(op);
     auto store = dyn_cast<AffineStoreOp>(op);
     int thisOpMemRefDim = -1;
-    bool isContiguous = load ? isContiguousAccess(loop.getInductionVar(), load,
-                                                  &thisOpMemRefDim)
-                             : isContiguousAccess(loop.getInductionVar(), store,
-                                                  &thisOpMemRefDim);
+    bool isContiguous =
+        load ? isContiguousAccess(loop.getInductionVar(),
+                                  (AffineReadOpInterface)load, &thisOpMemRefDim)
----------------
ftynse wrote:

Nit: I'd rather `cast<...>(load)`, C-style casting presumably works thanks to interface constructor from `Operation *` being public, but it isn't a good practice to use that.

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


More information about the Mlir-commits mailing list