/llvm-project/mlir/test/Dialect/Affine/ |
H A D | loop-fusion-3.mlir | 1 // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(func.func(affine-loo… 2 // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(func.func(affine-loo… 15 affine.for %arg4 = 0 to 3 { 16 affine.for %arg5 = 0 to 3 { 17 affine.store %cst, %0[%arg4, %arg5] : memref<3x3xf32> 20 affine.for %arg4 = 0 to 3 { 21 affine.for %arg5 = 0 to 3 { 22 affine.for %arg6 = 0 to 4 { 23 %1 = affine.load %arg1[%arg6, %arg5] : memref<4x3xf32> 24 %2 = affine.load %arg0[%arg4, %arg6] : memref<3x4xf32> [all …]
|
H A D | loop-fusion.mlir | 1 // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(func.func(affine-loo… 21 affine.for %i0 = 0 to 10 { 22 affine.store %cf7, %m[%i0] : memref<10xf32> 24 affine.for %i1 = 0 to 10 { 25 %v0 = affine.load %m[%i1] : memref<10xf32> 27 // CHECK: affine.for %{{.*}} = 0 to 10 { 28 // CHECK-NEXT: affine.store %{{.*}}, %{{.*}}[0] : memref<1xf32> 29 // CHECK-NEXT: affine.load %{{.*}}[0] : memref<1xf32> 45 affine.for %i0 = 0 to 10 { 46 affine.for %i1 = 0 to 10 { [all …]
|
H A D | scalrep.mlir | 1 // RUN: mlir-opt -allow-unregistered-dialect %s -affine-scalrep | FileCheck %s 14 affine.for %i0 = 0 to 10 { 15 affine.store %cf7, %m[%i0] : memref<10xf32> 16 %v0 = affine.load %m[%i0] : memref<10xf32> 22 // CHECK-NEXT: affine.for %{{.*}} = 0 to 10 { 34 affine.for %i0 = 0 to 10 { 35 affine.store %cf7, %m[%i0] : memref<10xf32> 36 %v0 = affine.load %m[%i0] : memref<10xf32> 38 affine.store %cf8, %m[%i0] : memref<10xf32> 39 affine [all...] |
H A D | affine-loop-invariant-code-motion.mlir | 1 // RUN: mlir-opt %s -affine-loop-invariant-code-motion -split-input-file | FileCheck %s 8 affine.for %arg0 = 0 to 10 { 10 affine.for %arg1 = 0 to 10 { 11 affine.store %v0, %m[%arg0] : memref<10xf32> 19 // CHECK-NEXT: affine.for %{{.*}} = 0 to 10 { 21 // CHECK-NEXT: affine.for %{{.*}} = 0 to 10 { 22 // CHECK-NEXT: affine.store 29 // The store-load forwarding can see through affine apply's since it relies on 35 affine.for %arg0 = 0 to 10 { 36 %t0 = affine [all...] |
H A D | loop-fusion-2.mlir | 1 // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(func.func(affine-loo… 2 // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(func.func(affine-loo… 14 affine.for %i0 = 0 to 64 { 15 affine.for %i1 = 0 to 4 { 16 affine.store %0, %out[%i0, %i1] : memref<64x4xf32> 19 affine.for %i2 = 0 to 4 { 20 affine.for %i3 = 0 to 4 { 21 affine.for %i4 = 0 to 16 { 22 %v = affine.load %arg1[16 * %i3 - %i4 + 15, %i2] : memref<64x4xf32> 25 affine.for %i5 = 0 to 4 { [all …]
|
H A D | loop-fusion-4.mlir | 1 // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(func.func(affine-loop-fusion{mode=producer}))' -split-input-file | FileCheck %s --check-prefix=PRODUCER-CONSUMER 2 // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(func.func(affine-loop-fusion{fusion-maximal mode=sibling}))' -split-input-file | FileCheck %s --check-prefix=SIBLING-MAXIMAL 3 // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(spirv.func(affine-loop-fusion{mode=producer}))' -split-input-file | FileCheck %s --check-prefix=SPIRV 16 affine.for %i0 = 0 to 7 { 17 affine.for %i1 = 0 to 8 { 18 affine.for %i2 = 0 to 9 { 19 affine.for %i3 = 0 to 10 { 20 affine.store %cf7, %m[720 * %i0 + 90 * %i1 + 10 * %i2 + %i3] : memref<5040xf32> 25 affine.for %i0 = 0 to 7 { 26 affine [all...] |
H A D | loop-unswitch.mlir | 1 // RUN: mlir-opt %s -split-input-file -pass-pipeline="builtin.module(func.func(test-affine-loop-uns… 8 affine.for %i = 0 to 100 { 9 affine.store %v, %A[%i] : memref<100xi32> 10 affine.for %j = 0 to 100 { 11 affine.store %v, %A[%j] : memref<100xi32> 12 affine.if affine_set<(d0) : (d0 - 2 >= 0)>(%i) { 13 affine.store %v, %B[%j] : memref<100xi32> 17 affine.store %v, %A[%i] : memref<100xi32> 23 // CHECK: affine.for %[[I:.*]] = 0 to 100 { 24 // CHECK-NEXT: affine.store %{{.*}}, %[[A]][%[[I]]] [all …]
|
H A D | parallelize.mlir | 1 // RUN: mlir-opt %s -allow-unregistered-dialect -affine-parallelize | FileCheck %s 2 // RUN: mlir-opt %s -allow-unregistered-dialect -affine-parallelize='max-nested=1' | FileCheck --ch… 3 // RUN: mlir-opt %s -allow-unregistered-dialect -affine-parallelize='parallel-reductions=1' | FileC… 10 affine.for %arg0 = 0 to 1 { 11 affine.for %arg1 = 0 to 8 { 12 affine.for %arg2 = 0 to 8 { 13 affine.for %arg3 = 0 to 64 { 14 affine.store %cst, %0[%arg0, %arg1, %arg2, %arg3] : memref<1x8x8x64xf32> 19 affine.for %arg0 = 0 to 1 { 20 affine.for %arg1 = 0 to 8 { [all …]
|
H A D | memref-bound-check.mlir | 14 affine.for %i = -1 to 10 { 15 affine.for %j = -1 to 10 { 16 %idx0 = affine.apply affine_map<(d0, d1) -> (d0)>(%i, %j) 17 %idx1 = affine.apply affine_map<(d0, d1) -> (d1)>(%i, %j) 19 %x = affine.load %A[%idx0, %idx1] : memref<9 x 9 x i32> 20 // expected-error@-1 {{'affine.load' op memref out of upper bound access along dimension #1}} 21 // expected-error@-2 {{'affine.load' op memref out of lower bound access along dimension #1}} 22 // expected-error@-3 {{'affine.load' op memref out of upper bound access along dimension #2}} 23 // expected-error@-4 {{'affine.load' op memref out of lower bound access along dimension #2}} 25 %idy = affine.apply affine_map<(d0, d1) -> (10*d0 - d1 + 19)>(%i, %j) [all …]
|
H A D | loop-fusion-inner.mlir | 1 // RUN: mlir-opt -pass-pipeline='builtin.module(func.func(affine-loop-fusion{mode=producer fusion-m… 3 // Test fusion of affine nests inside other region-holding ops (scf.for in the 10 affine.for %i = 0 to 100 { 14 affine.for %j = 0 to 10 { 15 %v = affine.load %A[%j] : memref<10xf32> 16 affine.store %v, %B[%j] : memref<10xf32> 19 affine.for %j = 0 to 10 { 20 %v = affine.load %B[%j] : memref<10xf32> 21 affine.store %v, %C[%j] : memref<10xf32> 25 // CHECK: affine.for %{{.*}} = 0 to 100 [all …]
|
H A D | loop-fusion-dependence-check.mlir | 19 affine.for %i0 = 0 to 10 { 21 %v0 = affine.load %a[%i0] : memref<10xf32> 22 affine.store %cf7, %b[%i0] : memref<10xf32> 24 affine.for %i1 = 0 to 10 { 25 affine.store %cf7, %a[%i1] : memref<10xf32> 26 %v1 = affine.load %c[%i1] : memref<10xf32> 28 affine.for %i2 = 0 to 10 { 30 %v2 = affine.load %b[%i2] : memref<10xf32> 31 affine.store %cf7, %c[%i2] : memref<10xf32> 53 affine.for %i0 = 0 to 10 { [all …]
|
H A D | canonicalize.mlir | 13 affine.for %i0 = 0 to 15 { 16 %x0 = affine.apply affine_map<(d0) -> (d0 - 1)> (%i0) 17 %x1_0 = affine.apply affine_map<(d0, d1) -> (d0)> (%x0, %x0) 18 %x1_1 = affine.apply affine_map<(d0, d1) -> (d1)> (%x0, %x0) 20 // CHECK: %[[I0A:.*]] = affine.apply #[[$MAP0]](%{{.*}}) 25 %y0 = affine.apply affine_map<(d0) -> (d0 + 1)> (%i0) 26 %y1_0 = affine.apply affine_map<(d0, d1) -> (d0)> (%y0, %y0) 27 %y1_1 = affine.apply affine_map<(d0, d1) -> (d1)> (%y0, %y0) 29 // CHECK-NEXT: %[[I1A:.*]] = affine.apply #[[$MAP1]](%{{.*}}) 34 %xy_0 = affine [all...] |
H A D | affine-data-copy.mlir | 1 // RUN: mlir-opt %s -split-input-file -affine-data-copy-generate="generate-dma=false fast-mem-space=0 skip-non-unit-stride-loops" | FileCheck %s 3 // RUN: mlir-opt %s -split-input-file -affine-data-copy-generate="generate-dma=false fast-mem-space=0 fast-mem-capacity=1" | FileCheck --check-prefix=CHECK-SMALL %s 5 // Test affine data copy with a memref filter. We use a test pass that invokes 6 // affine data copy utility on the input loop nest. 7 // '-test-affine-data-copy-memref-filter' passes the first memref found in an 8 // affine.load op in the innermost loop as a filter. 9 // RUN: mlir-opt %s -split-input-file -test-affine-data-copy='memref-filter' | FileCheck %s --check-prefix=FILTER 10 // RUN: mlir-opt %s -split-input-file -test-affine-data-copy='for-memref-region' | FileCheck %s --check-prefix=MEMREF_REGION 27 affine.for %i = 0 to 4096 step 128 { 28 affine [all...] |
H A D | load-store.mlir | 8 affine.for %i0 = 0 to 10 { 9 affine.for %i1 = 0 to 10 { 10 %1 = affine.load %0[%i0, %i1] : memref<100x100xf32> 11 // CHECK: %{{.*}} = affine.load %{{.*}}[%{{.*}}, %{{.*}}] : memref<100x100xf32> 22 affine.for %i0 = 0 to 10 { 23 affine.for %i1 = 0 to 10 { 24 %1 = affine.load %0[%i0 + 3, %i1 + 7] : memref<100x100xf32> 25 affine.store %1, %0[%i0 + 3, %i1 + 7] : memref<100x100xf32> 26 // CHECK: %{{.*}} = affine.load %{{.*}}[%{{.*}} + 3, %{{.*}} + 7] : memref<100x100xf32> 27 // CHECK: affine.store %{{.*}}, %{{.*}}[%{{.*}} + 3, %{{.*}} + 7] : memref<100x100xf32> [all …]
|
H A D | ops.mlir | 4 // Check that the attributes for the affine operations are round-tripped. 5 // Check that `affine.yield` is visible in the generic form. 8 // CHECK: affine.for 11 // GENERIC: "affine.for"() 13 // GENERIC-NEXT: "affine.yield"() : () -> () 15 affine.for %i = 0 to 10 { 18 // CHECK: affine.if 21 // GENERIC: "affine.if"() 22 // GENERIC-NEXT: "affine.yield"() : () -> () 25 affine [all...] |
H A D | dma-generate.mlir | 1 // RUN: mlir-opt -allow-unregistered-dialect %s -split-input-file -affine-data-copy-generate="gener… 2 // RUN: mlir-opt -allow-unregistered-dialect %s -split-input-file -affine-data-copy-generate="gener… 26 …// CHECK: affine.dma_start %{{.*}}[%{{.*}}], %{{.*}}[%{{.*}}], %{{.*}}[%{{.*}}], %{{.*}} : memref… 27 // CHECK: affine.dma_wait %{{.*}}[%{{.*}}], %{{.*}} : memref<1xi32> 33 …// CHECK: affine.dma_start %{{.*}}[%{{.*}}], %{{.*}}[%{{.*}}], %{{.*}}[%{{.*}}], %{{.*}} : m… 34 // CHECK-NEXT: affine.dma_wait %{{.*}}[%{{.*}}], %{{.*}} : memref<1xi32> 35 // CHECK: affine.for %[[IV:.*]] = 0 to 256 { 36 // CHECK-NEXT: affine.load %{{.*}}[%{{.*}}] : memref<256xf32, 2> 38 // Affine map for load on B is composed and becomes identity. 39 // CHECK: affine.load %{{.*}}[%[[IV]]] : memref<256xf32, 2> [all …]
|
H A D | invalid.mlir | 9 %0 = "affine.apply"(%arg0) {map = affine_map<(d0) -> (d0)>} : (i32) -> (index) 19 %0 = "affine.apply"(%arg0) {map = affine_map<(d0) -> (d0)>} : (index) -> (i32) 27 affine.load %M[%arg] : memref<10xi32> 41 affine.for %i0 = 0 to 7 { 43 affine.for %n0 = #map0(%i0)[%i0] to 7 { 54 affine.for %i0 = 0 to 7 { 56 affine.for %n0 = 0 to #map0(%i0)[%i0] { 67 affine.for %i0 = 0 to 7 { 69 affine.if #set0(%i0)[%i0] {} 79 affine [all...] |
H A D | unroll.mlir | 1 // RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-full" | FileCheck %s --… 2 // RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-full unroll-full-thresh… 3 // RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-factor=4" | FileCheck %… 4 // RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-factor=1" | FileCheck %… 5 // RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-factor=5 cleanup-unroll… 28 // UNROLL-FULL: affine.for %arg0 = 0 to 100 step 2 { 29 affine.for %i = 0 to 100 step 2 { 34 affine.for %j = 0 to 4 { 44 // UNROLL-FULL-NEXT: affine.for %arg0 = 0 to 100 step 2 { 45 affine.for %i = 0 to 100 step 2 { [all …]
|
H A D | loop-tiling.mlir | 1 // RUN: mlir-opt %s -split-input-file -affine-loop-tile="tile-size=32" | FileCheck %s 2 // RUN: mlir-opt %s -split-input-file -affine-loop-tile="cache-size=512" | FileCheck %s --check-pre… 3 // RUN: mlir-opt %s -split-input-file -affine-loop-tile="tile-size=32 separate" | FileCheck %s --ch… 13 // CHECK-NEXT: affine.for %{{.*}} = 0 to 256 step 32 { 14 // CHECK-NEXT: affine.for %{{.*}} = 0 to 512 step 32 { 15 // CHECK-NEXT: affine.for %{{.*}} = 0 to 1024 step 32 { 16 // CHECK-NEXT: affine.for %[[I:.*]] = [[$ID]](%{{.*}}) to [[$UB]](%{{.*}}) { 17 // CHECK-NEXT: affine.for %[[J:.*]] = [[$ID]](%{{.*}}) to [[$UB]](%{{.*}}) { 18 // CHECK-NEXT: affine.for %[[K:.*]] = [[$ID]](%{{.*}}) to [[$UB]](%{{.*}}) { 26 // CHECK-NEXT: affine.for %{{.*}} = 0 to 50 step 32 { [all …]
|
H A D | loop-fusion-transformation.mlir | 7 affine.for %i0 = 0 to 16 { 8 affine.store %cst, %0[%i0] : memref<100xf32> 10 affine.for %i1 = 0 to 5 { 11 %1 = affine.load %0[%i1] : memref<100xf32> 14 // CHECK: affine.for %[[IV0:.*]] = 0 to 5 { 15 // CHECK-NEXT: affine.store %{{.*}}, %{{.*}}[%[[IV0]]] : memref<100xf32> 16 // CHECK-NEXT: affine.load %{{.*}}[%[[IV0]]] : memref<100xf32> 33 affine.for %i0 = 0 to 10 { 34 affine.for %i1 = 0 to 10 { 35 %v0 = affine.load %b[%i0] : memref<10xf32> [all …]
|
/llvm-project/mlir/docs/Dialects/ |
H A D | Affine.md | 1 # 'affine' Dialect 3 This dialect provides a powerful abstraction for affine operations and analyses. 23 // A 2d to 3d affine mapping. 62 The affine dialect imposes certain restrictions on dimension and symbolic 84 [`affine.for`](#affinefor-mliraffineforop) and 85 [`affine.parallel`](#affineparallel-mliraffineparallelop) operations, and the result 86 of an [`affine.apply` operation](#affineapply-mliraffineapplyop) (which recursively 89 ### Affine Expressions 94 affine-expr ::= `(` affine [all...] |
/llvm-project/mlir/include/mlir/Dialect/Affine/ |
H A D | Passes.td | 1 //===-- Passes.td - Affine pass definition file ------------*- tablegen -*-===// 9 // This file contains definitions for passes within the Affine/ directory. 18 def AffineDataCopyGeneration : Pass<"affine-data-copy-generate", "func::FuncOp"> { 19 let summary = "Generate explicit copying for affine memory operations"; 20 let constructor = "mlir::affine::createAffineDataCopyGenerationPass()"; 46 def AffineLoopFusion : Pass<"affine-loop-fusion"> { 47 let summary = "Fuse affine loop nests"; 72 affine.for %arg2 = 0 to 10 { 73 affine.store %cst, %0[%arg2] : memref<10xf32> 74 affine [all...] |
/llvm-project/mlir/test/Dialect/Affine/SuperVectorize/ |
H A D | vectorize_reduction.mlir | 1 // RUN: mlir-opt %s -affine-super-vectorize="virtual-vector-size=128 test-fastest-varying=0 vectorize-reductions=true" -split-input-file | FileCheck %s 7 affine.for %i = 0 to 256 { 8 %final_red = affine.for %j = 0 to 512 iter_args(%red_iter = %cst) -> (f32) { 9 %ld = affine.load %in[%i, %j] : memref<256x512xf32> 11 affine.yield %add : f32 13 affine.store %final_red, %out[%i] : memref<256xf32> 19 // CHECK: affine.for %{{.*}} = 0 to 256 { 21 // CHECK: %[[vred:.*]] = affine.for %{{.*}} = 0 to 512 step 128 iter_args(%[[red_iter:.*]] = %[[vzero]]) -> (vector<128xf32>) { 24 // CHECK: affine.yield %[[add]] : vector<128xf32> 27 // CHECK: affine [all...] |
H A D | vectorize_affine_apply.mlir | 1 // RUN: mlir-opt %s -affine-super-vectorize="virtual-vector-size=8 test-fastest-varying=0" -split-input-file | FileCheck %s 9 // CHECK: affine.for %[[ARG2:.*]] = 0 to 8 { 10 // CHECK-NEXT: affine.for %[[ARG3:.*]] = 0 to 24 { 11 // CHECK-NEXT: affine.for %[[ARG4:.*]] = 0 to 48 step 8 { 12 // CHECK-NEXT: %[[S0:.*]] = affine.apply #[[$MAP_ID0]](%[[ARG3]]) 13 // CHECK-NEXT: %[[S1:.*]] = affine.apply #[[$MAP_ID1]](%[[ARG4]]) 21 affine.for %arg2 = 0 to 8 { 22 affine.for %arg3 = 0 to 24 { 23 affine.for %arg4 = 0 to 48 { 24 %0 = affine [all...] |
/llvm-project/mlir/lib/AsmParser/ |
H A D | AffineParser.cpp | 1 //===- AffineParser.cpp - MLIR Affine Parser ------------------------------===// 9 // This file implements a parser for Affine structures. 55 /// This is a specialized parser for affine structures (affine maps, affine 78 // Binary affine op parsing. 116 /// Create an affine binary high precedence op expression (mul's, div's, mod). 126 emitError(opLoc, "non-affine expression: at least one of the multiply " in getAffineBinaryOpExpr() 133 emitError(opLoc, "non-affine expression: right operand of floordiv " in getAffineBinaryOpExpr() 140 emitError(opLoc, "non-affine expression: right operand of ceildiv " in getAffineBinaryOpExpr() 147 emitError(opLoc, "non-affine expression: right operand of mod " in getAffineBinaryOpExpr() 153 llvm_unreachable("can't create affine expression for null high prec op"); in getAffineBinaryOpExpr() [all …]
|