diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -343,9 +343,7 @@ // 2.9 loop Construct //===----------------------------------------------------------------------===// -def OpenACC_LoopOp : OpenACC_Op<"loop", - [AttrSizedOperandSegments, - SingleBlockImplicitTerminator<"acc::YieldOp">]> { +def OpenACC_LoopOp : OpenACC_Op<"loop", [AttrSizedOperandSegments]> { let summary = "loop construct"; let description = [{ @@ -367,7 +365,6 @@ ``` }]; - let arguments = (ins OptionalAttr:$collapse, Optional:$gangNum, Optional:$gangStatic, diff --git a/mlir/test/Dialect/OpenACC/ops.mlir b/mlir/test/Dialect/OpenACC/ops.mlir --- a/mlir/test/Dialect/OpenACC/ops.mlir +++ b/mlir/test/Dialect/OpenACC/ops.mlir @@ -323,6 +323,37 @@ // ----- +func.func @acc_loop_multiple_block() { + acc.parallel { + acc.loop { + %c1 = arith.constant 1 : index + cf.br ^bb1(%c1 : index) + ^bb1(%9: index): + %c0 = arith.constant 0 : index + %12 = arith.cmpi sgt, %9, %c0 : index + cf.cond_br %12, ^bb2, ^bb3 + ^bb2: + %c1_0 = arith.constant 1 : index + %c10 = arith.constant 10 : index + %22 = arith.subi %c10, %c1_0 : index + cf.br ^bb1(%22 : index) + ^bb3: + acc.yield + } + acc.yield + } + return +} + +// CHECK-LABEL: func.func @acc_loop_multiple_block() +// CHECK: acc.parallel +// CHECK: acc.loop +// CHECK-3: ^bb{{.*}} +// CHECK: acc.yield +// CHECK: acc.yield + +// ----- + func.func @testparallelop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>) -> () { %i64value = arith.constant 1 : i64 %i32value = arith.constant 1 : i32