20 lines · plain
1// RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(convert-scf-to-cf), func.func(test-print-liveness))"2 3module {4 func.func @for_if_for(%arg0: index, %arg1: index, %arg2: index, %arg3: i1) {5 %cst = arith.constant dense<0.000000e+00> : tensor<128x32xf16>6 %0 = scf.for %arg4 = %arg0 to %arg1 step %arg2 iter_args(%arg5 = %cst) -> (tensor<128x32xf16>) {7 %1 = scf.if %arg3 -> (tensor<128x32xf16>) {8 scf.yield %arg5 : tensor<128x32xf16>9 } else {10 %2 = scf.for %arg6 = %arg0 to %arg1 step %arg2 iter_args(%arg7 = %arg5) -> (tensor<128x32xf16>) {11 scf.yield %arg7 : tensor<128x32xf16>12 }13 scf.yield %2 : tensor<128x32xf16>14 }15 scf.yield %1 : tensor<128x32xf16>16 }17 18 return19 }20}