2 // RUN: mlir-opt -allow-unregistered-dialect -test-scf-for-utils=test-replace-with-new-yields -mlir-disable-threading %s | FileCheck %s
4 func.func @doubleup(%lb: index, %ub: index, %step: index, %extra_arg: f32) -> f32 {
5 %0 = scf.for %i = %lb to %ub step %step iter_args(%iter = %extra_arg) -> (f32) {
6 %1 = arith.addf %iter, %iter : f32
11 // CHECK-LABEL: func @doubleup
12 // CHECK-SAME: %[[ARG:[a-zA-Z0-9]+]]: f32
13 // CHECK: %[[NEWLOOP:.+]]:2 = scf.for
14 // CHECK-SAME: iter_args(%[[INIT1:.+]] = %[[ARG]], %[[INIT2:.+]] = %[[ARG]]
15 // CHECK: %[[DOUBLE:.+]] = arith.addf %[[INIT1]], %[[INIT1]]
16 // CHECK: %[[DOUBLE2:.+]] = arith.addf %[[DOUBLE]], %[[DOUBLE]]
17 // CHECK: scf.yield %[[DOUBLE]], %[[DOUBLE2]]
18 // CHECK: return %[[NEWLOOP]]#0