@@ -27,8 +27,7 @@ func.func @simple_test_1(%0: index, %1: index, %2: index, %lb: index, %ub: index
27
27
// CHECK-DAG: #[[$c42:.*]] = affine_map<() -> (42)>
28
28
// CHECK-DAG: #[[$id:.*]] = affine_map<()[s0] -> (s0)>
29
29
// CHECK-DAG: #[[$add:.*]] = affine_map<()[s0, s1] -> (s0 + s1)>
30
- // CHECK-DAG: #[[$div32div4timesm4:.*]] = affine_map<()[s0] -> (((s0 floordiv 32) floordiv 4) * -4)>
31
- // CHECK-DAG: #[[$div32:.*]] = affine_map<()[s0] -> (s0 floordiv 32)>
30
+ // CHECK-DAG: #[[$div32mod4:.*]] = affine_map<()[s0] -> ((s0 floordiv 32) mod 4)>
32
31
33
32
// CHECK-LABEL: func.func @simple_test_2
34
33
// CHECK-SAME: %[[I0:[0-9a-zA-Z]+]]: index,
@@ -45,10 +44,8 @@ func.func @simple_test_2(%0: index, %1: index, %2: index, %lb: index, %ub: index
45
44
// CHECK: %[[R2:.*]] = affine.apply #[[$add]]()[%[[c42]], %[[R1]]]
46
45
// CHECK: scf.for %[[j:.*]] =
47
46
scf.for %j = %lb to %ub step %step {
48
- // CHECK: %[[R3:.*]] = affine.apply #[[$div32div4timesm4]]()[%[[j]]]
49
- // CHECK: %[[R4:.*]] = affine.apply #[[$add]]()[%[[R2]], %[[R3]]]
50
- // CHECK: %[[R5:.*]] = affine.apply #[[$div32]]()[%[[j]]]
51
- // CHECK: %[[a:.*]] = affine.apply #[[$add]]()[%[[R4]], %[[R5]]]
47
+ // CHECK: %[[R3:.*]] = affine.apply #[[$div32mod4]]()[%[[j]]]
48
+ // CHECK: %[[a:.*]] = affine.apply #[[$add]]()[%[[R2]], %[[R3]]]
52
49
%a = affine.apply affine_map <(d0 )[s0 ] -> ((d0 floordiv 32 ) mod 4 + s0 + 42 )>(%j )[%i ]
53
50
54
51
// CHECK: "some_side_effecting_consumer"(%[[a]]) : (index) -> ()
@@ -67,8 +64,7 @@ func.func @simple_test_2(%0: index, %1: index, %2: index, %lb: index, %ub: index
67
64
// CHECK-DAG: #[[$div4timesm32:.*]] = affine_map<()[s0] -> ((s0 floordiv 4) * -32)>
68
65
// CHECK-DAG: #[[$times8:.*]] = affine_map<()[s0] -> (s0 * 8)>
69
66
// CHECK-DAG: #[[$id:.*]] = affine_map<()[s0] -> (s0)>
70
- // CHECK-DAG: #[[$div32div4timesm4:.*]] = affine_map<()[s0] -> (((s0 floordiv 32) floordiv 4) * -4)>
71
- // CHECK-DAG: #[[$div32:.*]] = affine_map<()[s0] -> (s0 floordiv 32)>
67
+ // CHECK-DAG: #[[$div32mod4:.*]] = affine_map<()[s0] -> ((s0 floordiv 32) mod 4)>
72
68
73
69
// CHECK-LABEL: func.func @larger_test
74
70
// CHECK-SAME: %[[I0:[0-9a-zA-Z]+]]: index,
@@ -126,10 +122,8 @@ func.func @larger_test(%0: index, %1: index, %2: index, %lb: index, %ub: index,
126
122
// CHECK-NEXT: %[[e:.*]] = affine.apply #[[$add]]()[%[[c]], %[[idk]]]
127
123
%e = affine.apply affine_map <()[s0 , s1 ] -> (s0 + s1 * 8 - (s1 floordiv 4 ) * 32 )>()[%k , %0 ]
128
124
129
- // CHECK-NEXT: %[[R15:.*]] = affine.apply #[[$div32div4timesm4]]()[%[[k]]]
130
- // CHECK-NEXT: %[[R16:.*]] = affine.apply #[[$add]]()[%[[idj]], %[[R15]]]
131
- // CHECK-NEXT: %[[R17:.*]] = affine.apply #[[$div32]]()[%[[k]]]
132
- // CHECK-NEXT: %[[f:.*]] = affine.apply #[[$add]]()[%[[R16]], %[[R17]]]
125
+ // CHECK-NEXT: %[[R15:.*]] = affine.apply #[[$div32mod4]]()[%[[k]]]
126
+ // CHECK-NEXT: %[[f:.*]] = affine.apply #[[$add]]()[%[[idj]], %[[R15]]]
133
127
%f = affine.apply affine_map <(d0 )[s0 ] -> ((d0 floordiv 32 ) mod 4 + s0 )>(%k )[%j ]
134
128
135
129
// CHECK-NEXT: %[[g:.*]] = affine.apply #[[$add]]()[%[[b]], %[[idk]]]
0 commit comments