Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/inline_trivial_sair_ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// CHECK-LABEL: @one_map
func @one_map() -> f32 {
// CHECK: %[[v0:.*]] = constant 1.0
// CHECK-DAG: %[[v0:.*]] = constant 1.0
%0 = constant 1.0 : f32
// CHECK-NOT: sair.program
%1 = sair.program {
Expand All @@ -25,7 +25,7 @@ func @one_map() -> f32 {

// CHECK-LABEL: @sequence
func @sequence() -> f32 {
// CHECK: %[[v0:.*]] = constant 1.0
// CHECK-DAG: %[[v0:.*]] = constant 1.0
%0 = constant 1.0 : f32
// CHECK-NOT: sair.program
%6 = sair.program {
Expand Down
6 changes: 3 additions & 3 deletions test/introduce_loops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,13 @@ func @dependent_dims() {
}]
} {
^bb0(%arg0: index):
// CHECK: %[[V4:.*]] = constant 8
// CHECK-DAG: %[[V4:.*]] = constant 8
%4 = constant 8 : index
// CHECK: %[[V5:.*]] = addi %[[V3]], %[[V4]]
%5 = addi %arg0, %4 : index
sair.return %arg0, %5 : index, index
} : #sair.shape<d0:static_range<64, 8>>, () -> (index, index)
// CHECK: %[[V6:.*]] = constant 1
// CHECK-DAG: %[[V6:.*]] = constant 1
%3 = sair.dyn_range[d0:%0] %1(d0), %2(d0) : !sair.dyn_range<d0:static_range<64, 8>>
// CHECK: scf.for %[[V7:.*]] = %[[V3]] to %[[V5]] step %[[V6]] {
sair.map[d0:%0, d1:%3] attributes {
Expand Down Expand Up @@ -299,7 +299,7 @@ func @partial_unroll() {
%0 = sair.static_range : !sair.static_range<5>
// CHECK: sair.map
// CHECK-SAME: loop_nest = []
// CHECK: %[[STEP:.*]] = constant 2 : index
// CHECK-DAG: %[[STEP:.*]] = constant 2 : index
// CHECK: scf.for %{{.*}} = %{{.*}} to %{{.*}} step %[[STEP]] {
// CHECK-COUNT-2: call @baz()
// CHECK: }
Expand Down
6 changes: 3 additions & 3 deletions test/lower_to_map.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func @load_from_memref(%arg0 : memref<?x?xf32>) {
// CHECK: = sair.map[d0:%{{.*}}, d1:%{{.*}}, d2:%{{.*}}] %{{.*}}, %{{.*}}#0(d0), %{{.*}}#1(d0)
// CHECK: ^{{.*}}(%[[ARG1:.*]]: index, %[[ARG2:.*]]: index, %[[ARG3:.*]]: index, %[[MEMREF:.*]]: memref<?x?xf32>, %[[ARG4:.*]]: index, %[[ARG5:.*]]: index):
// CHECK: %[[I0:.*]] = affine.apply affine_map<(d0, d1, d2)[s0] -> (d2 - s0)>(%[[ARG1]], %[[ARG2]], %[[ARG3]])[%[[ARG4]]]
// CHECK: %[[C0:.*]] = constant 0
// CHECK-DAG: %[[C0:.*]] = constant 0
// CHECK: %[[I1:.*]] = affine.apply affine_map<(d0, d1, d2)[s0] -> ((d1 - s0) floordiv 2)>(%[[ARG1]], %[[ARG2]], %[[ARG3]])[%[[C0]]]
// CHECK: %[[VALUE:.*]] = memref.load %[[MEMREF]][%[[I0]], %[[I1]]] : memref<?x?xf32>
// CHECK: sair.return %[[VALUE]] : f32
Expand All @@ -132,9 +132,9 @@ func @store_to_memref(%arg0 : f32, %arg1 : memref<?x?xf32>) {

// CHECK: sair.map[d0:%{{.*}}, d1:%{{.*}}, d2:%{{.*}}] %{{.*}}, %{{.*}}(d0, d1, d2)
// CHECK: ^{{.*}}(%[[ARG1:.*]]: index, %[[ARG2:.*]]: index, %[[ARG3:.*]]: index, %[[MEMREF:.*]]: memref<?x?xf32>, %[[VALUE:.*]]: f32):
// CHECK: %[[C0_0:.*]] = constant 0
// CHECK-DAG: %[[C0_0:.*]] = constant 0
// CHECK: %[[I0:.*]] = affine.apply affine_map<(d0, d1, d2)[s0] -> (d2 - s0)>(%[[ARG1]], %[[ARG2]], %[[ARG3]])[%[[C0_0]]]
// CHECK: %[[C0_1:.*]] = constant 0
// CHECK-DAG: %[[C0_1:.*]] = constant 0
// CHECK: %[[I1:.*]] = affine.apply affine_map<(d0, d1, d2)[s0] -> (d1 - s0)>(%[[ARG1]], %[[ARG2]], %[[ARG3]])[%[[C0_1]]]
// CHECK: memref.store %[[VALUE]], %[[MEMREF]][%[[I0]], %[[I1]]]
// CHECK: sair.return
Expand Down
4 changes: 2 additions & 2 deletions test/materialize_buffers.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ func @loop_nest(%arg0: f32) {
// CHECK: } {
// CHECK: ^{{.*}}(%[[ARG0:.*]]: index):
// CHECK: %[[V1:.*]] = affine.apply affine_map<(d0) -> (d0)>(%[[ARG0]])
// CHECK: %[[C4:.*]] = constant 4
// CHECK-DAG: %[[C4:.*]] = constant 4
// CHECK: %[[V2:.*]] = addi %[[V1]], %[[C4]]
// CHECK: %[[C16:.*]] = constant 16
// CHECK-DAG: %[[C16:.*]] = constant 16
// CHECK: %[[V3:.*]] = cmpi ult, %[[C16]], %[[V2]]
// CHECK: %[[V4:.*]] = select %[[V3]], %[[C16]], %[[V2]]
// CHECK: %[[V5:.*]] = affine.apply affine_map<(d0, d1) -> (d1 - d0)>
Expand Down
12 changes: 6 additions & 6 deletions test/normalize_loops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ func @stripe() {
// CHECK: loop_nest = [{iter = #sair.mapping_expr<d0>, name = "loopA"}]
// CHECK: ^bb0(%[[ARG0:.*]]: index):
// CHECK: %[[V1:.*]] = affine.apply affine_map<(d0) -> (d0)>(%arg0)
// CHECK: %[[V2:.*]] = constant 4 : index
// CHECK-DAG: %[[V2:.*]] = constant 4 : index
// CHECK: %[[V3:.*]] = addi %[[V1]], %[[V2]] : index
// CHECK: %[[V4:.*]] = constant 62 : index
// CHECK-DAG: %[[V4:.*]] = constant 62 : index
// CHECK: %[[V5:.*]] = cmpi ult, %[[V4]], %[[V3]] : index
// CHECK: %[[V6:.*]] = select %[[V5]], %[[V4]], %[[V3]] : index
// CHECK: sair.return %[[V1]], %[[V6]] : index, index
Expand Down Expand Up @@ -243,9 +243,9 @@ func @sequence_attr(%arg0: f32) {
// CHECK-SAME: sequence = 0
// CHECK: ^{{.*}}(%[[ARG:.*]]: index):
// CHECK: %[[V1:.*]] = affine.apply affine_map<(d0) -> (d0)>(%[[ARG]])
// CHECK: %[[C4:.*]] = constant 4
// CHECK-DAG: %[[C4:.*]] = constant 4
// CHECK: %[[V2:.*]] = addi %[[V1]], %[[C4]]
// CHECK: %[[C16:.*]] = constant 16
// CHECK-DAG: %[[C16:.*]] = constant 16
// CHECK: %[[V3:.*]] = cmpi ult, %[[C16]], %[[V2]]
// CHECK: %[[V4:.*]] = select %[[V3]], %[[C16]], %[[V2]]
// CHECK: sair.return %[[V1]], %[[V4]]
Expand Down Expand Up @@ -345,9 +345,9 @@ func @sequence_attr_inversion(%arg0: f32) {
// CHECK-SAME: sequence = 0
// CHECK: ^{{.*}}(%[[ARG:.*]]: index):
// CHECK: %[[V1:.*]] = affine.apply affine_map<(d0) -> (d0)>(%[[ARG]])
// CHECK: %[[C4:.*]] = constant 4
// CHECK-DAG: %[[C4:.*]] = constant 4
// CHECK: %[[V2:.*]] = addi %[[V1]], %[[C4]]
// CHECK: %[[C16:.*]] = constant 16
// CHECK-DAG: %[[C16:.*]] = constant 16
// CHECK: %[[V3:.*]] = cmpi ult, %[[C16]], %[[V2]]
// CHECK: %[[V4:.*]] = select %[[V3]], %[[C16]], %[[V2]]
// CHECK: sair.return %[[V1]], %[[V4]]
Expand Down
2 changes: 1 addition & 1 deletion test/roundtrip.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func @map_reduce(%arg0 : f32, %arg1 : i32, %arg2 : f64) {

// CHECK-LABEL: @from_scalar
func @from_scalar() {
// CHECK: %[[V0:.*]] = constant 1 : index
// CHECK-DAG: %[[V0:.*]] = constant 1 : index
%0 = constant 1 : index
sair.program {
// CHECK: %{{.*}} sair.from_scalar %[[V0]] : !sair.value<(), index>
Expand Down