|
1 | 1 | // RUN: mlir-opt %s --loop-invariant-code-motion | FileCheck %s
|
2 | 2 |
|
3 |
| -func.func private @side_effect(%arg0 : f32, %arg1 : f32, %arg2 : f32) |
| 3 | +func.func private @side_effect(%arg0 : f32, %arg1 : f32) |
4 | 4 |
|
5 | 5 | // CHECK-LABEL: func @broadcast_hoisting
|
6 | 6 | // CHECK-SAME: (%[[ARG:.*]]: f32, %[[IDX:.*]]: i32, {{.*}}: index)
|
7 | 7 | func.func @broadcast_hoisting(%arg0 : f32, %arg1 : i32, %arg2 : index) {
|
8 | 8 | %c0 = arith.constant 0 : index
|
9 | 9 | %c1 = arith.constant 1 : index
|
10 |
| -// `any_lane` and `specific_lane` can be speculated across the control flow, but |
| 10 | +// `specific_lane` can be speculated across the control flow, but |
11 | 11 | // `first_active_lane` cannot as active lanes can change.
|
12 |
| -// CHECK: %[[V1:.*]] = gpu.subgroup_broadcast %[[ARG]], any_lane : f32 |
13 |
| -// CHECK: %[[V2:.*]] = gpu.subgroup_broadcast %[[ARG]], specific_lane %[[IDX]] : f32 |
| 12 | +// CHECK: %[[V1:.*]] = gpu.subgroup_broadcast %[[ARG]], specific_lane %[[IDX]] : f32 |
14 | 13 | // CHECK: scf.for
|
15 | 14 | // CHECK: %[[V0:.*]] = gpu.subgroup_broadcast %[[ARG]], first_active_lane : f32
|
16 |
| -// CHECK: func.call @side_effect(%[[V0]], %[[V1]], %[[V2]]) |
| 15 | +// CHECK: func.call @side_effect(%[[V0]], %[[V1]]) |
17 | 16 | scf.for %i = %c0 to %arg2 step %c1 {
|
18 | 17 | %0 = gpu.subgroup_broadcast %arg0, first_active_lane : f32
|
19 |
| - %1 = gpu.subgroup_broadcast %arg0, any_lane : f32 |
20 |
| - %2 = gpu.subgroup_broadcast %arg0, specific_lane %arg1 : f32 |
21 |
| - func.call @side_effect(%0, %1, %2) : (f32, f32, f32) -> () |
| 18 | + %1 = gpu.subgroup_broadcast %arg0, specific_lane %arg1 : f32 |
| 19 | + func.call @side_effect(%0, %1) : (f32, f32) -> () |
22 | 20 | }
|
23 | 21 | func.return
|
24 | 22 | }
|
0 commit comments