Skip to content

Commit 31aecda

Browse files
authored
add test
1 parent f2b6302 commit 31aecda

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mlir/test/Transforms/remove-dead-values.mlir

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,22 @@ func.func @main(%arg3 : i32, %arg4 : i1) {
408408

409409
// -----
410410

411+
// The scf.if operation represents an if-then-else construct for conditionally
412+
// executing two regions of code. The 'the' region has exactly 1 block, and
413+
// the 'else' region may have 0 or 1 block. This case is to ensure 'else' region
414+
// with 0 block not crash.
415+
416+
// CHECK-LABEL: func.func @clean_region_branch_op_with_empty_region
417+
func.func @clean_region_branch_op_with_empty_region(%arg0: i1, %arg1: memref<f32>) {
418+
%cst = arith.constant 1.000000e+00 : f32
419+
scf.if %arg0 {
420+
memref.store %cst, %arg1[] : memref<f32>
421+
}
422+
return
423+
}
424+
425+
// -----
426+
411427
#map = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
412428
func.func @kernel(%arg0: memref<18xf32>) {
413429
%c1 = arith.constant 1 : index

0 commit comments

Comments
 (0)