For instance:
func @for_yields_3(%lb : index, %ub : index, %step : index) -> (i32, i32, i32) { %a = call @make_i32() : () -> (i32) %b = call @make_i32() : () -> (i32) %r:3 = scf.for %i = %lb to %ub step %step iter_args(%0 = %a, %1 = %a, %2 = %b) -> (i32, i32, i32) { %c = call @make_i32() : () -> (i32) scf.yield %0, %c, %2 : i32, i32, i32 } return %r#0, %r#1, %r#2 : i32, i32, i32 }
Canonicalizes as:
func @for_yields_3(%arg0: index, %arg1: index, %arg2: index) -> (i32, i32, i32) { %0 = call @make_i32() : () -> i32 %1 = call @make_i32() : () -> i32 %2 = scf.for %arg3 = %arg0 to %arg1 step %arg2 iter_args(%arg4 = %0) -> (i32) { %3 = call @make_i32() : () -> i32 scf.yield %3 : i32 } return %0, %2, %1 : i32, i32, i32 }
Nit: spurious /