Skip to content

Commit 800aa8f

Browse files
committed
Reviwe feedback, fix vector test
1 parent 464dddf commit 800aa8f

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

mlir/lib/Dialect/GPU/IR/ValueBoundsOpInterfaceImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct GpuIdOpInterface
3535
cstr.bound(v) >= range.smin().getSExtValue();
3636
cstr.bound(v) <= range.smax().getSExtValue();
3737
};
38-
// No arguments, so we don't need to pass in their ranges.
38+
assert(inferrable->getNumOperands() == 0 && "ID ops have no operands");
3939
inferrable.inferResultRanges({}, translateConstraint);
4040
}
4141
};

mlir/test/Dialect/GPU/value-bounds-op-interface-impl.mlir

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ func.func @launch_func(%arg0 : index) {
6262
"test.compare"(%thread_id_z, %c0) {cmp = "GE"} : (index, index) -> ()
6363
// expected-remark @below{{true}}
6464
"test.compare"(%thread_id_z, %c2) {cmp = "LT"} : (index, index) -> ()
65+
66+
// expected-remark @below{{true}}
67+
"test.compare"(%thread_id_x, %block_dim_x) {cmp = "LT"} : (index, index) -> ()
6568
gpu.terminator
6669
}
6770

@@ -114,6 +117,8 @@ module attributes {gpu.container_module} {
114117
// expected-remark @below{{true}}
115118
"test.compare"(%block_dim_x, %c8) {cmp = "EQ"} : (index, index) -> ()
116119

120+
// expected-remark @below{{true}}
121+
"test.compare"(%thread_id_x, %block_dim_x) {cmp = "LT"} : (index, index) -> ()
117122
gpu.return
118123
}
119124
}
@@ -144,6 +149,10 @@ module attributes {gpu.container_module} {
144149
// expected-remark @below{{true}}
145150
"test.compare"(%thread_id_x, %c8) {cmp = "LT"} : (index, index) -> ()
146151

152+
// Note: there isn't a way to express the ID <= size constraint
153+
// in this form
154+
// expected-error @below{{unknown}}
155+
"test.compare"(%thread_id_x, %block_dim_x) {cmp = "LT"} : (index, index) -> ()
147156
gpu.return
148157
}
149158
}

mlir/test/Dialect/Vector/test-scalable-bounds.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(test-affine-reify-value-bounds))' -cse -verify-diagnostics \
1+
// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(test-affine-reify-value-bounds, cse))' -verify-diagnostics \
22
// RUN: -verify-diagnostics -split-input-file | FileCheck %s
33

44
#map_dim_i = affine_map<(d0)[s0] -> (-d0 + 32400, s0)>

0 commit comments

Comments
 (0)