diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td --- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td @@ -124,7 +124,7 @@ let arguments = (ins Variadic:$varList); - let assemblyFormat = "attr-dict ($varList^ `:` type($varList))?"; + let assemblyFormat = [{ `(` attr-dict ($varList^ `:` type($varList))? `)` }]; } //===----------------------------------------------------------------------===// diff --git a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir --- a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir +++ b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir @@ -20,7 +20,7 @@ br ^bb1(%3, %4 : index, index) // CHECK-NEXT: ^[[BB3]]: ^bb3: - omp.flush + omp.flush() omp.barrier omp.taskwait omp.taskyield diff --git a/mlir/test/Dialect/OpenMP/ops.mlir b/mlir/test/Dialect/OpenMP/ops.mlir --- a/mlir/test/Dialect/OpenMP/ops.mlir +++ b/mlir/test/Dialect/OpenMP/ops.mlir @@ -29,19 +29,19 @@ } // CHECK-LABEL: func @omp_flush -// CHECK-SAME: %[[ARG0:.*]]: !llvm.i32 +// CHECK-SAME: ([[ARG0:%.*]]: !llvm.i32) { func @omp_flush(%arg0 : !llvm.i32) -> () { // Test without data var - // CHECK: omp.flush - omp.flush + // CHECK: omp.flush() + omp.flush () // Test with one data var - // CHECK: omp.flush %[[ARG0]] : !llvm.i32 - "omp.flush"(%arg0) : (!llvm.i32) -> () + // CHECK: omp.flush( [[ARG0]] : !llvm.i32) + omp.flush(%arg0 : !llvm.i32) // Test with two data var - // CHECK: omp.flush %[[ARG0]], %[[ARG0]] : !llvm.i32, !llvm.i32 - "omp.flush"(%arg0, %arg0): (!llvm.i32, !llvm.i32) -> () + // CHECK: omp.flush( [[ARG0]], [[ARG0]] : !llvm.i32, !llvm.i32) + omp.flush(%arg0, %arg0: !llvm.i32, !llvm.i32) return } diff --git a/mlir/test/Target/openmp-llvm.mlir b/mlir/test/Target/openmp-llvm.mlir --- a/mlir/test/Target/openmp-llvm.mlir +++ b/mlir/test/Target/openmp-llvm.mlir @@ -21,13 +21,21 @@ // CHECK-LABEL: define void @test_flush_construct(i32 %0) llvm.func @test_flush_construct(%arg0: !llvm.i32) { // CHECK: call void @__kmpc_flush(%struct.ident_t* @{{[0-9]+}} - omp.flush + omp.flush () // CHECK: call void @__kmpc_flush(%struct.ident_t* @{{[0-9]+}} - omp.flush %arg0 : !llvm.i32 + omp.flush (%arg0 : !llvm.i32) // CHECK: call void @__kmpc_flush(%struct.ident_t* @{{[0-9]+}} - omp.flush %arg0, %arg0 : !llvm.i32, !llvm.i32 + omp.flush (%arg0, %arg0 : !llvm.i32, !llvm.i32) + + %0 = llvm.mlir.constant(1 : i64) : !llvm.i64 + // CHECK: alloca {{.*}} align 4 + %1 = llvm.alloca %0 x !llvm.i32 {in_type = i32, name = "a"} : (!llvm.i64) -> !llvm.ptr + // CHECK: call void @__kmpc_flush(%struct.ident_t* @{{[0-9]+}} + omp.flush () + // CHECK: load i32, i32* + %2 = llvm.load %1 : !llvm.ptr // CHECK-NEXT: ret void llvm.return