File tree 1 file changed +21
-0
lines changed
compiler/src/iree/compiler/DispatchCreation/test
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -226,3 +226,24 @@ util.func public @hoist_both_src_and_encoding() -> tensor<640x320xf32> {
226
226
// CHECK: %[[CST:.+]] = arith.constant
227
227
// CHECK: %[[SET_ENCODING:.+]] = iree_encoding.set_encoding %[[CST]]
228
228
// CHECK: flow.dispatch.region
229
+
230
+ // -----
231
+
232
+ // It tests that the constant-like source is already outside the region, and the
233
+ // hoisting does not happen to it. Otherwise, it crashes.
234
+
235
+ #encoding = #iree_encoding.testing_encoding <>
236
+ util.func private @get_tensor (tensor <640 x320 xf32 , #encoding >) -> tensor <640 x320 xf32 >
237
+ util.func public @hoist_encoding_only () -> tensor <640 x320 xf32 > {
238
+ %cst = arith.constant dense <1.0 > : tensor <640 x320 xf32 >
239
+ %0 = flow.dispatch.region -> (tensor <640 x320 xf32 >) {
240
+ %1 = iree_encoding.set_encoding %cst : tensor <640 x320 xf32 > -> tensor <640 x320 xf32 , #encoding >
241
+ %2 = util.call @get_tensor (%1 ) : (tensor <640 x320 xf32 , #encoding >) -> tensor <640 x320 xf32 >
242
+ flow.return %2 : tensor <640 x320 xf32 >
243
+ }
244
+ util.return %0 : tensor <640 x320 xf32 >
245
+ }
246
+ // CHECK-LABEL: util.func public @hoist_encoding_only(
247
+ // CHECK: %[[CST:.+]] = arith.constant
248
+ // CHECK: %[[SET_ENCODING:.+]] = iree_encoding.set_encoding %[[CST]]
249
+ // CHECK: flow.dispatch.region
You can’t perform that action at this time.
0 commit comments