[MLIR][SCF] Parenthesize multiple return types in scf.execute_region asm op

Previously, ExecuteRegionOps with multiple return values would fail a round-trip test due to missing parenthesis around the types.

Differential Revision: https://reviews.llvm.org/D108402
This commit is contained in:
Morten Borup Petersen 2021-08-19 20:34:43 +01:00
parent 73323c6eaa
commit 6c1436a9b0
2 changed files with 7 additions and 2 deletions

View File

@ -115,8 +115,7 @@ static ParseResult parseExecuteRegionOp(OpAsmParser &parser,
static void print(OpAsmPrinter &p, ExecuteRegionOp op) {
p << ExecuteRegionOp::getOperationName();
if (op.getNumResults() > 0)
p << " -> " << op.getResultTypes();
p.printOptionalArrowTypeList(op.getResultTypes());
p.printRegion(op.region(),
/*printEntryBlockArgs=*/false,

View File

@ -291,6 +291,12 @@ func @execute_region() -> i64 {
scf.yield %c1 : i64
}
// CHECK: scf.execute_region -> (i64, i64) {
%res2:2 = scf.execute_region -> (i64, i64) {
%c1 = constant 1 : i64
scf.yield %c1, %c1 : i64, i64
}
// CHECK: scf.execute_region {
// CHECK-NEXT: br ^bb1
// CHECK-NEXT: ^bb1: