[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:05 PST 2024


================
@@ -0,0 +1,67 @@
+// RUN: mlir-opt %s -split-input-file -test-affine-access-analysis -verify-diagnostics | FileCheck %s
+
+// CHECK-LABEL: func @loop_1d
+func.func @loop_1d(%A : memref<?x?xf32>, %B : memref<?x?x?xf32>) {
+   %c0 = arith.constant 0 : index
+   %M = memref.dim %A, %c0 : memref<?x?xf32>
+   affine.for %i = 0 to %M {
+     affine.for %j = 0 to %M {
+       affine.load %A[%c0, %i] : memref<?x?xf32>
+       // expected-remark at -1 {{contiguous along loop 0}}
----------------
ftynse wrote:

Nit: here and below, it is possible to use `// expected-remark @above {{..}}` to reduce the brittleness of manual line offset calculation. This construct works across multiple `expected-remark` directives, and potentially other comments.

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


More information about the Mlir-commits mailing list