[Mlir-commits] [flang] [mlir] [MLIR][OpenMP] Remove terminators from loop wrappers (PR #112229)
Sergio Afonso
llvmlistbot at llvm.org
Tue Oct 15 02:32:33 PDT 2024
https://github.com/skatrak updated https://github.com/llvm/llvm-project/pull/112229
>From 3b037b964848758bdf15d3f431842b0f292f6930 Mon Sep 17 00:00:00 2001
From: Sergio Afonso <safonsof at amd.com>
Date: Mon, 14 Oct 2024 16:45:21 +0100
Subject: [PATCH] [MLIR][OpenMP] Remove terminators from loop wrappers
This patch simplifies the representation of OpenMP loop wrapper operations by
introducing the `NoTerminator` trait and updating accordingly the verifier for
the `LoopWrapperInterface`.
Since loop wrappers are already limited to having exactly one region containing
exactly one block, and this block can only hold a single `omp.loop_nest` or
loop wrapper and an `omp.terminator` that does not return any values, it makes
sense to simplify the representation of loop wrappers by removing the
terminator.
There is an extensive list of Lit tests that needed updating to remove the
`omp.terminator`s adding some noise to this patch, but actual changes are
limited to the definition of the `omp.wsloop`, `omp.simd`, `omp.distribute` and
`omp.taskloop` loop wrapper ops, Flang lowering for those,
`LoopWrapperInterface::verifyImpl()`, SCF to OpenMP conversion and OpenMP
dialect documentation.
---
.../lib/Lower/OpenMP/DataSharingProcessor.cpp | 23 ++--
flang/lib/Lower/OpenMP/OpenMP.cpp | 3 -
.../Fir/convert-to-llvm-openmp-and-fir.fir | 10 --
.../Todo/omp-default-clause-inner-loop.f90 | 1 -
flang/test/Lower/OpenMP/copyin.f90 | 2 -
.../Lower/OpenMP/default-clause-byref.f90 | 1 -
flang/test/Lower/OpenMP/default-clause.f90 | 1 -
flang/test/Lower/OpenMP/hlfir-wsloop.f90 | 1 -
.../Lower/OpenMP/lastprivate-commonblock.f90 | 1 -
flang/test/Lower/OpenMP/lastprivate-iv.f90 | 2 -
flang/test/Lower/OpenMP/location.f90 | 11 +-
.../parallel-lastprivate-clause-scalar.f90 | 6 -
.../OpenMP/parallel-private-clause-fixes.f90 | 1 -
.../Lower/OpenMP/parallel-private-clause.f90 | 3 -
.../parallel-reduction-allocatable-array.f90 | 1 -
.../parallel-reduction-pointer-array.f90 | 1 -
.../test/Lower/OpenMP/parallel-reduction3.f90 | 1 -
.../OpenMP/parallel-wsloop-firstpriv.f90 | 2 -
.../Lower/OpenMP/parallel-wsloop-lastpriv.f90 | 4 -
flang/test/Lower/OpenMP/parallel-wsloop.f90 | 8 --
.../Lower/OpenMP/private-derived-type.f90 | 1 -
flang/test/Lower/OpenMP/simd.f90 | 1 -
.../test/Lower/OpenMP/stop-stmt-in-region.f90 | 1 -
flang/test/Lower/OpenMP/target.f90 | 1 -
flang/test/Lower/OpenMP/unstructured.f90 | 7 --
flang/test/Lower/OpenMP/wsloop-chunks.f90 | 3 -
flang/test/Lower/OpenMP/wsloop-collapse.f90 | 1 -
flang/test/Lower/OpenMP/wsloop-monotonic.f90 | 1 -
.../test/Lower/OpenMP/wsloop-nonmonotonic.f90 | 1 -
flang/test/Lower/OpenMP/wsloop-ordered.f90 | 2 -
.../OpenMP/wsloop-reduction-add-byref.f90 | 7 --
.../Lower/OpenMP/wsloop-reduction-add.f90 | 7 --
...oop-reduction-allocatable-array-minmax.f90 | 2 -
.../OpenMP/wsloop-reduction-allocatable.f90 | 1 -
.../wsloop-reduction-array-assumed-shape.f90 | 1 -
.../Lower/OpenMP/wsloop-reduction-array.f90 | 1 -
.../Lower/OpenMP/wsloop-reduction-array2.f90 | 1 -
.../OpenMP/wsloop-reduction-iand-byref.f90 | 1 -
.../Lower/OpenMP/wsloop-reduction-iand.f90 | 1 -
.../OpenMP/wsloop-reduction-ieor-byref.f90 | 1 -
.../Lower/OpenMP/wsloop-reduction-ieor.f90 | 1 -
.../OpenMP/wsloop-reduction-ior-byref.f90 | 1 -
.../Lower/OpenMP/wsloop-reduction-ior.f90 | 1 -
.../wsloop-reduction-logical-and-byref.f90 | 3 -
.../OpenMP/wsloop-reduction-logical-and.f90 | 3 -
.../wsloop-reduction-logical-eqv-byref.f90 | 3 -
.../OpenMP/wsloop-reduction-logical-eqv.f90 | 3 -
.../wsloop-reduction-logical-neqv-byref.f90 | 3 -
.../OpenMP/wsloop-reduction-logical-neqv.f90 | 3 -
.../wsloop-reduction-logical-or-byref.f90 | 3 -
.../OpenMP/wsloop-reduction-logical-or.f90 | 3 -
.../OpenMP/wsloop-reduction-max-byref.f90 | 3 -
.../Lower/OpenMP/wsloop-reduction-max.f90 | 3 -
.../OpenMP/wsloop-reduction-min-byref.f90 | 3 -
.../Lower/OpenMP/wsloop-reduction-min.f90 | 3 -
.../Lower/OpenMP/wsloop-reduction-min2.f90 | 1 -
.../OpenMP/wsloop-reduction-mul-byref.f90 | 7 --
.../Lower/OpenMP/wsloop-reduction-mul.f90 | 7 --
.../Lower/OpenMP/wsloop-reduction-multi.f90 | 1 -
.../wsloop-reduction-multiple-clauses.f90 | 1 -
.../Lower/OpenMP/wsloop-reduction-pointer.f90 | 1 -
flang/test/Lower/OpenMP/wsloop-schedule.f90 | 1 -
.../test/Lower/OpenMP/wsloop-unstructured.f90 | 1 -
flang/test/Lower/OpenMP/wsloop-variable.f90 | 5 -
flang/test/Lower/OpenMP/wsloop.f90 | 3 -
mlir/docs/Dialects/OpenMPDialect/_index.md | 12 +-
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | 37 +++----
.../Conversion/SCFToOpenMP/SCFToOpenMP.cpp | 3 -
mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp | 26 ++---
mlir/test/CAPI/execution_engine.c | 1 -
.../OpenMPToLLVM/convert-to-llvmir.mlir | 7 --
.../Conversion/SCFToOpenMP/reductions.mlir | 2 -
.../Conversion/SCFToOpenMP/scf-to-openmp.mlir | 5 -
.../Dialect/LLVMIR/legalize-for-export.mlir | 1 -
mlir/test/Dialect/OpenMP/invalid.mlir | 104 +-----------------
mlir/test/Dialect/OpenMP/ops.mlir | 91 ---------------
.../LLVMIR/omptarget-parallel-wsloop.mlir | 1 -
.../LLVMIR/omptarget-wsloop-collapsed.mlir | 1 -
mlir/test/Target/LLVMIR/omptarget-wsloop.mlir | 2 -
.../LLVMIR/openmp-data-target-device.mlir | 1 -
mlir/test/Target/LLVMIR/openmp-llvm.mlir | 40 -------
mlir/test/Target/LLVMIR/openmp-nested.mlir | 2 -
mlir/test/Target/LLVMIR/openmp-reduction.mlir | 6 -
.../openmp-wsloop-reduction-cleanup.mlir | 1 -
84 files changed, 50 insertions(+), 485 deletions(-)
diff --git a/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp b/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
index 2369dcd32d5e50..709ac402cc702d 100644
--- a/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
+++ b/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
@@ -195,20 +195,19 @@ void DataSharingProcessor::insertLastPrivateCompare(mlir::Operation *op) {
// Update the original variable just before exiting the worksharing
// loop. Conversion as follows:
//
- // omp.wsloop / omp.simd { omp.wsloop / omp.simd {
- // omp.loop_nest { omp.loop_nest {
- // ... ...
- // store ===> store
- // omp.yield %v = arith.addi %iv, %step
- // } %cmp = %step < 0 ? %v < %ub : %v > %ub
- // omp.terminator fir.if %cmp {
- // } fir.store %v to %loopIV
- // ^%lpv_update_blk:
+ // omp.wsloop / omp.simd { omp.wsloop / omp.simd {
+ // omp.loop_nest { omp.loop_nest {
+ // ... ...
+ // store ===> store
+ // omp.yield %v = arith.addi %iv, %step
+ // } %cmp = %step < 0 ? %v < %ub : %v > %ub
+ // } fir.if %cmp {
+ // fir.store %v to %loopIV
+ // ^%lpv_update_blk:
+ // }
+ // omp.yield
// }
- // omp.yield
// }
- // omp.terminator
- // }
// Only generate the compare once in presence of multiple LastPrivate
// clauses.
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index a89029b720e788..70d89f5e521a59 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -1094,9 +1094,6 @@ static OpTy genWrapperOp(lower::AbstractConverter &converter,
// Create entry block with arguments.
genEntryBlock(converter, args, op.getRegion());
- firOpBuilder.setInsertionPoint(
- lower::genOpenMPTerminator(firOpBuilder, op, loc));
-
return op;
}
diff --git a/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir b/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
index aa2f416063fced..335877e7c9a872 100644
--- a/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
+++ b/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
@@ -17,7 +17,6 @@ func.func @_QPsb1(%arg0: !fir.ref<i32> {fir.bindc_name = "n"}, %arg1: !fir.ref<!
fir.store %3 to %6 : !fir.ref<i32>
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -43,7 +42,6 @@ func.func @_QPsb1(%arg0: !fir.ref<i32> {fir.bindc_name = "n"}, %arg1: !fir.ref<!
// CHECK: llvm.store %[[I1]], %[[ARR_I_REF]] : i32, !llvm.ptr
// CHECK: omp.yield
// CHECK: }
-// CHECK: omp.terminator
// CHECK: }
// CHECK: omp.terminator
// CHECK: }
@@ -93,7 +91,6 @@ func.func @_QPsb(%arr: !fir.box<!fir.array<?xi32>> {fir.bindc_name = "arr"}) {
fir.store %indx to %3 : !fir.ref<i32>
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -110,7 +107,6 @@ func.func @_QPsb(%arr: !fir.box<!fir.array<?xi32>> {fir.bindc_name = "arr"}) {
// CHECK-NEXT: omp.loop_nest (%[[INDX:.*]]) : i32 = (%[[C1]]) to (%[[C50]]) inclusive step (%[[C1]]) {
// CHECK: llvm.store %[[INDX]], %{{.*}} : i32, !llvm.ptr
// CHECK: omp.yield
-// CHECK: omp.terminator
// CHECK: omp.terminator
// CHECK: llvm.return
@@ -200,7 +196,6 @@ func.func @_QPsimd1(%arg0: !fir.ref<i32> {fir.bindc_name = "n"}, %arg1: !fir.ref
fir.store %3 to %6 : !fir.ref<i32>
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -226,7 +221,6 @@ func.func @_QPsimd1(%arg0: !fir.ref<i32> {fir.bindc_name = "n"}, %arg1: !fir.ref
// CHECK: llvm.store %[[I1]], %[[ARR_I_REF]] : i32, !llvm.ptr
// CHECK: omp.yield
// CHECK: }
-// CHECK: omp.terminator
// CHECK: }
// CHECK: omp.terminator
// CHECK: }
@@ -519,7 +513,6 @@ func.func @_QPsimd_with_nested_loop() {
fir.store %7 to %3 : !fir.ref<i32>
omp.yield
}
- omp.terminator
}
return
}
@@ -540,7 +533,6 @@ func.func @_QPsimd_with_nested_loop() {
// CHECK: ^bb3:
// CHECK: omp.yield
// CHECK: }
-// CHECK: omp.terminator
// CHECK: }
// CHECK: llvm.return
// CHECK: }
@@ -736,7 +728,6 @@ func.func @_QPsb() {
// CHECK: %[[RES_EXT:.*]] = llvm.zext %[[RES]] : i1 to i32
// CHECK: llvm.store %[[RES_EXT]], %[[PRV]] : i32, !llvm.ptr
// CHECK: omp.yield
-// CHECK: omp.terminator
// CHECK: omp.terminator
// CHECK: llvm.return
@@ -781,7 +772,6 @@ func.func @_QPsimple_reduction(%arg0: !fir.ref<!fir.array<100x!fir.logical<4>>>
fir.store %11 to %prv : !fir.ref<!fir.logical<4>>
omp.yield
}
- omp.terminator
}
omp.terminator
}
diff --git a/flang/test/Lower/OpenMP/Todo/omp-default-clause-inner-loop.f90 b/flang/test/Lower/OpenMP/Todo/omp-default-clause-inner-loop.f90
index 42ebd37d1c4313..77a1304f39a488 100644
--- a/flang/test/Lower/OpenMP/Todo/omp-default-clause-inner-loop.f90
+++ b/flang/test/Lower/OpenMP/Todo/omp-default-clause-inner-loop.f90
@@ -24,7 +24,6 @@
! CHECK: fir.store %[[result]] to %{{.*}} : !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/copyin.f90 b/flang/test/Lower/OpenMP/copyin.f90
index b1c6b9420f4c46..f3d147c10668f4 100644
--- a/flang/test/Lower/OpenMP/copyin.f90
+++ b/flang/test/Lower/OpenMP/copyin.f90
@@ -166,7 +166,6 @@ subroutine copyin_derived_type()
! CHECK: fir.call @_QPsub4(%[[VAL_9]]#1) fastmath<contract> : (!fir.ref<i32>) -> ()
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -338,7 +337,6 @@ subroutine common_1()
! CHECK: hlfir.assign %[[VAL_40]] to %[[VAL_31]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/default-clause-byref.f90 b/flang/test/Lower/OpenMP/default-clause-byref.f90
index 6cdff407a97901..654c13ada9e39f 100644
--- a/flang/test/Lower/OpenMP/default-clause-byref.f90
+++ b/flang/test/Lower/OpenMP/default-clause-byref.f90
@@ -350,7 +350,6 @@ subroutine skipped_default_clause_checks()
!CHECK-NEXT: omp.loop_nest (%[[ARG:.*]]) {{.*}} {
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!CHECK: omp.terminator
!CHECK: }
diff --git a/flang/test/Lower/OpenMP/default-clause.f90 b/flang/test/Lower/OpenMP/default-clause.f90
index 1b1b47c40b545c..c004813a911f73 100644
--- a/flang/test/Lower/OpenMP/default-clause.f90
+++ b/flang/test/Lower/OpenMP/default-clause.f90
@@ -390,7 +390,6 @@ subroutine skipped_default_clause_checks()
!CHECK-NEXT: omp.loop_nest (%[[ARG:.*]]) {{.*}} {
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!CHECK: omp.terminator
!CHECK: }
diff --git a/flang/test/Lower/OpenMP/hlfir-wsloop.f90 b/flang/test/Lower/OpenMP/hlfir-wsloop.f90
index fc5b5999f2708d..f7b0ba681efebf 100644
--- a/flang/test/Lower/OpenMP/hlfir-wsloop.f90
+++ b/flang/test/Lower/OpenMP/hlfir-wsloop.f90
@@ -22,7 +22,6 @@ subroutine simple_loop
print*, i
end do
! CHECK: omp.yield
- ! CHECK: omp.terminator
!$OMP END DO
! CHECK: omp.terminator
!$OMP END PARALLEL
diff --git a/flang/test/Lower/OpenMP/lastprivate-commonblock.f90 b/flang/test/Lower/OpenMP/lastprivate-commonblock.f90
index dcba34b2da8ef5..faa3d3e053f345 100644
--- a/flang/test/Lower/OpenMP/lastprivate-commonblock.f90
+++ b/flang/test/Lower/OpenMP/lastprivate-commonblock.f90
@@ -32,7 +32,6 @@
!CHECK: }
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
subroutine lastprivate_common
common /c/ x, y
diff --git a/flang/test/Lower/OpenMP/lastprivate-iv.f90 b/flang/test/Lower/OpenMP/lastprivate-iv.f90
index 609192471eae1d..63a81e818bc8ba 100644
--- a/flang/test/Lower/OpenMP/lastprivate-iv.f90
+++ b/flang/test/Lower/OpenMP/lastprivate-iv.f90
@@ -28,7 +28,6 @@
!CHECK: }
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
subroutine lastprivate_iv_inc()
integer :: i
@@ -66,7 +65,6 @@ subroutine lastprivate_iv_inc()
!CHECK: }
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
subroutine lastprivate_iv_dec()
integer :: i
diff --git a/flang/test/Lower/OpenMP/location.f90 b/flang/test/Lower/OpenMP/location.f90
index 5d340937a81ce0..2dab22a1c1f90d 100644
--- a/flang/test/Lower/OpenMP/location.f90
+++ b/flang/test/Lower/OpenMP/location.f90
@@ -35,7 +35,6 @@ subroutine sub_loop()
print *, i
!CHECK: omp.yield loc(#[[LOOP_LOC:.*]])
!CHECK: } loc(#[[LOOP_LOC]])
-!CHECK: omp.terminator loc(#[[LOOP_LOC]])
!CHECK: } loc(#[[LOOP_LOC]])
end do
!$omp end do
@@ -64,8 +63,8 @@ subroutine sub_if(c)
!CHECK: #[[PAR_LOC]] = loc("{{.*}}location.f90":9:9)
!CHECK: #[[TAR_LOC]] = loc("{{.*}}location.f90":21:9)
!CHECK: #[[LOOP_LOC]] = loc("{{.*}}location.f90":33:9)
-!CHECK: #[[BAR_LOC]] = loc("{{.*}}location.f90":47:9)
-!CHECK: #[[TW_LOC]] = loc("{{.*}}location.f90":49:9)
-!CHECK: #[[TY_LOC]] = loc("{{.*}}location.f90":51:9)
-!CHECK: #[[IF_LOC]] = loc("{{.*}}location.f90":58:14)
-!CHECK: #[[TASK_LOC]] = loc("{{.*}}location.f90":58:9)
+!CHECK: #[[BAR_LOC]] = loc("{{.*}}location.f90":46:9)
+!CHECK: #[[TW_LOC]] = loc("{{.*}}location.f90":48:9)
+!CHECK: #[[TY_LOC]] = loc("{{.*}}location.f90":50:9)
+!CHECK: #[[IF_LOC]] = loc("{{.*}}location.f90":57:14)
+!CHECK: #[[TASK_LOC]] = loc("{{.*}}location.f90":57:9)
diff --git a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90
index bc5baf4e1cf604..86309a24f91a03 100644
--- a/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90
+++ b/flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90
@@ -41,7 +41,6 @@
!CHECK: }
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
subroutine lastprivate_character(arg1)
@@ -80,7 +79,6 @@ subroutine lastprivate_character(arg1)
!CHECK: }
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
subroutine lastprivate_int(arg1)
@@ -124,7 +122,6 @@ subroutine lastprivate_int(arg1)
!CHECK: }
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
subroutine mult_lastprivate_int(arg1, arg2)
@@ -169,7 +166,6 @@ subroutine mult_lastprivate_int(arg1, arg2)
!CHECK: }
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
subroutine mult_lastprivate_int2(arg1, arg2)
@@ -217,7 +213,6 @@ subroutine mult_lastprivate_int2(arg1, arg2)
!CHECK-NEXT: }
!CHECK-NEXT: omp.yield
!CHECK-NEXT: }
-!CHECK-NEXT: omp.terminator
!CHECK-NEXT: }
subroutine firstpriv_lastpriv_int(arg1, arg2)
@@ -265,7 +260,6 @@ subroutine firstpriv_lastpriv_int(arg1, arg2)
!CHECK-NEXT: }
!CHECK-NEXT: omp.yield
!CHECK-NEXT: }
-!CHECK-NEXT: omp.terminator
!CHECK-NEXT: }
subroutine firstpriv_lastpriv_int2(arg1)
diff --git a/flang/test/Lower/OpenMP/parallel-private-clause-fixes.f90 b/flang/test/Lower/OpenMP/parallel-private-clause-fixes.f90
index 073146b8b2e87a..5e76e8ff1663bf 100644
--- a/flang/test/Lower/OpenMP/parallel-private-clause-fixes.f90
+++ b/flang/test/Lower/OpenMP/parallel-private-clause-fixes.f90
@@ -91,7 +91,6 @@
! CHECK: fir.store %[[VAL_12]]#1 to %[[PRIV_J_DECL]]#1 : !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/parallel-private-clause.f90 b/flang/test/Lower/OpenMP/parallel-private-clause.f90
index edb8f9193b827c..8dc843fc9d96ae 100644
--- a/flang/test/Lower/OpenMP/parallel-private-clause.f90
+++ b/flang/test/Lower/OpenMP/parallel-private-clause.f90
@@ -272,7 +272,6 @@ subroutine simple_loop_1
print*, i
end do
! FIRDialect: omp.yield
- ! FIRDialect: omp.terminator
!$OMP END DO
! FIRDialect: omp.terminator
!$OMP END PARALLEL
@@ -306,7 +305,6 @@ subroutine simple_loop_2
print*, i
end do
! FIRDialect: omp.yield
- ! FIRDialect: omp.terminator
! FIRDialect: {{%.*}} = fir.load %[[R_DECL]]#0 : !fir.ref<!fir.box<!fir.heap<f32>>>
! FIRDialect: fir.if {{%.*}} {
! FIRDialect: [[LD:%.*]] = fir.load %[[R_DECL]]#0 : !fir.ref<!fir.box<!fir.heap<f32>>>
@@ -346,7 +344,6 @@ subroutine simple_loop_3
print*, i
end do
! FIRDialect: omp.yield
- ! FIRDialect: omp.terminator
! FIRDialect: {{%.*}} = fir.load [[R_DECL]]#0 : !fir.ref<!fir.box<!fir.heap<f32>>>
! FIRDialect: fir.if {{%.*}} {
! FIRDialect: [[LD:%.*]] = fir.load [[R_DECL]]#0 : !fir.ref<!fir.box<!fir.heap<f32>>>
diff --git a/flang/test/Lower/OpenMP/parallel-reduction-allocatable-array.f90 b/flang/test/Lower/OpenMP/parallel-reduction-allocatable-array.f90
index 7a2db3299784c7..dabd495d733b55 100644
--- a/flang/test/Lower/OpenMP/parallel-reduction-allocatable-array.f90
+++ b/flang/test/Lower/OpenMP/parallel-reduction-allocatable-array.f90
@@ -115,7 +115,6 @@ program reduce
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_29]] : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/parallel-reduction-pointer-array.f90 b/flang/test/Lower/OpenMP/parallel-reduction-pointer-array.f90
index 1273b250117da4..01d8dc33f40e6f 100644
--- a/flang/test/Lower/OpenMP/parallel-reduction-pointer-array.f90
+++ b/flang/test/Lower/OpenMP/parallel-reduction-pointer-array.f90
@@ -127,7 +127,6 @@ program reduce
! CHECK: hlfir.assign %[[VAL_36]] to %[[VAL_39]] : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/parallel-reduction3.f90 b/flang/test/Lower/OpenMP/parallel-reduction3.f90
index 591f41cb946602..70b4f0f12820be 100644
--- a/flang/test/Lower/OpenMP/parallel-reduction3.f90
+++ b/flang/test/Lower/OpenMP/parallel-reduction3.f90
@@ -102,7 +102,6 @@
! CHECK: hlfir.destroy %[[VAL_28]] : !hlfir.expr<?xi32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-firstpriv.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-firstpriv.f90
index de3f42be104829..4e7c2c15df7432 100644
--- a/flang/test/Lower/OpenMP/parallel-wsloop-firstpriv.f90
+++ b/flang/test/Lower/OpenMP/parallel-wsloop-firstpriv.f90
@@ -29,7 +29,6 @@ subroutine omp_do_firstprivate(a)
! CHECK-NEXT: fir.call @_QPfoo(%[[I_PVT_DECL]]#1, %[[A_PVT_DECL]]#1) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
! CHECK-NEXT: omp.yield
! CHECK-NEXT: }
- ! CHECK-NEXT: omp.terminator
! CHECK-NEXT: }
do i=1, a
call foo(i, a)
@@ -70,7 +69,6 @@ subroutine omp_do_firstprivate2(a, n)
! CHECK: fir.store %[[ARG2]] to %[[I_PVT_DECL]]#1 : !fir.ref<i32>
! CHECK: fir.call @_QPfoo(%[[I_PVT_DECL]]#1, %[[A_PVT_DECL]]#1) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
! CHECK: omp.yield
- ! CHECK: omp.terminator
do i= a, n
call foo(i, a)
end do
diff --git a/flang/test/Lower/OpenMP/parallel-wsloop-lastpriv.f90 b/flang/test/Lower/OpenMP/parallel-wsloop-lastpriv.f90
index 254aeff21d06ed..dbde5291c01c8b 100644
--- a/flang/test/Lower/OpenMP/parallel-wsloop-lastpriv.f90
+++ b/flang/test/Lower/OpenMP/parallel-wsloop-lastpriv.f90
@@ -39,7 +39,6 @@ subroutine omp_do_lastprivate(a)
! CHECK-NEXT: omp.yield
! CHECK-NEXT: }
- ! CHECK-NEXT: omp.terminator
! CHECK-NEXT: }
do i=1, a
call foo(i, a)
@@ -90,7 +89,6 @@ subroutine omp_do_lastprivate2(a, n)
! CHECK: }
! CHECK: omp.yield
- ! CHECK: omp.terminator
do i= a, n
call foo(i, a)
end do
@@ -148,7 +146,6 @@ subroutine omp_do_lastprivate_collapse2(a)
! CHECK-NEXT: omp.yield
! CHECK-NEXT: }
- ! CHECK-NEXT: omp.terminator
! CHECK-NEXT: }
do i=1, a
do j=1, a
@@ -224,7 +221,6 @@ subroutine omp_do_lastprivate_collapse3(a)
! CHECK-NEXT: omp.yield
! CHECK-NEXT: }
- ! CHECK-NEXT: omp.terminator
! CHECK-NEXT: }
do i=1, a
do j=1, a
diff --git a/flang/test/Lower/OpenMP/parallel-wsloop.f90 b/flang/test/Lower/OpenMP/parallel-wsloop.f90
index 4a9c66857ffaaf..cba5209f85989b 100644
--- a/flang/test/Lower/OpenMP/parallel-wsloop.f90
+++ b/flang/test/Lower/OpenMP/parallel-wsloop.f90
@@ -21,7 +21,6 @@ subroutine simple_parallel_do
end do
! CHECK: omp.yield
! CHECK: omp.terminator
- ! CHECK: omp.terminator
!$OMP END PARALLEL DO
end subroutine
@@ -51,7 +50,6 @@ subroutine parallel_do_with_parallel_clauses(cond, nt)
end do
! CHECK: omp.yield
! CHECK: omp.terminator
- ! CHECK: omp.terminator
!$OMP END PARALLEL DO
end subroutine
@@ -77,7 +75,6 @@ subroutine parallel_do_with_clauses(nt)
end do
! CHECK: omp.yield
! CHECK: omp.terminator
- ! CHECK: omp.terminator
!$OMP END PARALLEL DO
end subroutine
@@ -120,7 +117,6 @@ subroutine parallel_do_with_privatisation_clauses(cond,nt)
end do
! CHECK: omp.yield
! CHECK: omp.terminator
- ! CHECK: omp.terminator
!$OMP END PARALLEL DO
end subroutine
@@ -165,7 +161,6 @@ end subroutine parallel_private_do
! CHECK: fir.call @_QPfoo(%[[I_PRIV_DECL]]#1, %[[COND_DECL]]#1, %[[NT_PRIV_DECL]]#1) {{.*}}: (!fir.ref<i32>, !fir.ref<!fir.logical<4>>, !fir.ref<i32>) -> ()
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -212,7 +207,6 @@ end subroutine omp_parallel_multiple_firstprivate_do
! CHECK: fir.call @_QPbar(%[[I_PRIV_DECL]]#1, %[[A_PRIV_DECL]]#1) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -264,7 +258,6 @@ end subroutine parallel_do_private
! CHECK: fir.call @_QPfoo(%[[I_PRIV_DECL]]#1, %[[COND_PRIV_DECL]]#1, %[[NT_PRIV_DECL]]#1) {{.*}}: (!fir.ref<i32>, !fir.ref<!fir.logical<4>>, !fir.ref<i32>) -> ()
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -317,7 +310,6 @@ end subroutine omp_parallel_do_multiple_firstprivate
! CHECK: fir.call @_QPbar(%[[I_PRIV_DECL]]#1, %[[A_PRIV_DECL]]#1) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/private-derived-type.f90 b/flang/test/Lower/OpenMP/private-derived-type.f90
index 230484f20c11d8..af9a5b72e71759 100644
--- a/flang/test/Lower/OpenMP/private-derived-type.f90
+++ b/flang/test/Lower/OpenMP/private-derived-type.f90
@@ -37,7 +37,6 @@ end subroutine s4
! Check we do call FortranAInitialize on the derived type
! CHECK: %[[VAL_30:.*]] = fir.call @_FortranAInitialize(%[[VAL_28]], %[[VAL_29]], %[[VAL_27]]) fastmath<contract> : (!fir.box<none>, !fir.ref<i8>, i32) -> none
! CHECK: omp.wsloop {
-! CHECK: omp.terminator
! CHECK: }
! CHECK: %[[VAL_39:.*]] = fir.embox %[[VAL_9]]#1 : (!fir.ref<!fir.type<_QFs4Ty3{x:!fir.box<!fir.heap<i32>>}>>) -> !fir.box<!fir.type<_QFs4Ty3{x:!fir.box<!fir.heap<i32>>}>>
! CHECK: %[[VAL_40:.*]] = fir.convert %[[VAL_39]] : (!fir.box<!fir.type<_QFs4Ty3{x:!fir.box<!fir.heap<i32>>}>>) -> !fir.box<none>
diff --git a/flang/test/Lower/OpenMP/simd.f90 b/flang/test/Lower/OpenMP/simd.f90
index 3b2aeceb4c3f9f..f574a1265e06c4 100644
--- a/flang/test/Lower/OpenMP/simd.f90
+++ b/flang/test/Lower/OpenMP/simd.f90
@@ -267,7 +267,6 @@ subroutine lastprivate_with_simd
!CHECK: }
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!$omp simd lastprivate(sum)
do i = 1, 100
diff --git a/flang/test/Lower/OpenMP/stop-stmt-in-region.f90 b/flang/test/Lower/OpenMP/stop-stmt-in-region.f90
index f8f2604caacca1..d119c2120c7c58 100644
--- a/flang/test/Lower/OpenMP/stop-stmt-in-region.f90
+++ b/flang/test/Lower/OpenMP/stop-stmt-in-region.f90
@@ -106,7 +106,6 @@ subroutine test_stop_in_region3()
! CHECK: ^bb3:
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: cf.br ^bb1
! CHECK: ^bb1:
diff --git a/flang/test/Lower/OpenMP/target.f90 b/flang/test/Lower/OpenMP/target.f90
index ab33b6b3808315..63a43e750979d5 100644
--- a/flang/test/Lower/OpenMP/target.f90
+++ b/flang/test/Lower/OpenMP/target.f90
@@ -601,7 +601,6 @@ subroutine omp_target_parallel_do
end do
!CHECK: omp.yield
!CHECK: }
- !CHECK: omp.terminator
!CHECK: }
!CHECK: omp.terminator
!CHECK: }
diff --git a/flang/test/Lower/OpenMP/unstructured.f90 b/flang/test/Lower/OpenMP/unstructured.f90
index e7860b1d6ca8c4..a0955c8440c1c8 100644
--- a/flang/test/Lower/OpenMP/unstructured.f90
+++ b/flang/test/Lower/OpenMP/unstructured.f90
@@ -79,7 +79,6 @@ subroutine ss2(n) ! unstructured OpenMP construct; loop exit inside construct
! CHECK: @_FortranAioOutputInteger32(%{{.*}}, %[[LOAD_1]])
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: %[[ALLOCA_1:.*]] = fir.alloca i32 {{{.*}}, pinned, {{.*}}}
@@ -101,7 +100,6 @@ subroutine ss2(n) ! unstructured OpenMP construct; loop exit inside construct
! CHECK: ^bb6: // 2 preds: ^bb2, ^bb4
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: br ^bb1
! CHECK: ^bb4: // pred: ^bb1
@@ -144,7 +142,6 @@ subroutine ss3(n) ! nested unstructured OpenMP constructs
! CHECK: }
! CHECK-NEXT: omp.yield
! CHECK-NEXT: }
-! CHECK-NEXT: omp.terminator
! CHECK-NEXT: }
! CHECK: omp.terminator
! CHECK-NEXT: }
@@ -179,7 +176,6 @@ subroutine ss4(n) ! CYCLE in OpenMP wsloop constructs
! CHECK: ^[[BB6]]:
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -222,7 +218,6 @@ subroutine ss5() ! EXIT inside OpenMP wsloop (inside parallel)
! CHECK: ^[[BB6]]:
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: br ^[[BB1_OUTER]]
! CHECK: ^[[BB3_OUTER]]:
@@ -269,7 +264,6 @@ subroutine ss6() ! EXIT inside OpenMP wsloop in a do loop (inside parallel)
! CHECK-NEXT: ^[[BB6]]:
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -310,7 +304,6 @@ subroutine ss7() ! EXIT inside OpenMP parallel do (inside do loop)
! CHECK-NEXT: ^[[BB6]]:
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-chunks.f90 b/flang/test/Lower/OpenMP/wsloop-chunks.f90
index cacb5b0d4b4a1e..0fb7d6f1b64faa 100644
--- a/flang/test/Lower/OpenMP/wsloop-chunks.f90
+++ b/flang/test/Lower/OpenMP/wsloop-chunks.f90
@@ -27,7 +27,6 @@ program wsloop
! CHECK: {{.*}} = fir.call @_FortranAioOutputInteger32({{.*}}, %[[LOAD_IV]]) {{.*}}: (!fir.ref<i8>, i32) -> i1
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
end do
@@ -50,7 +49,6 @@ program wsloop
! CHECK: {{.*}} = fir.call @_FortranAioOutputInteger32({{.*}}, %[[VAL_25]]) {{.*}}: (!fir.ref<i8>, i32) -> i1
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
end do
@@ -77,7 +75,6 @@ program wsloop
! CHECK: {{.*}} = fir.call @_FortranAioOutputInteger32({{.*}}, %[[VAL_40]]) {{.*}}: (!fir.ref<i8>, i32) -> i1
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: return
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-collapse.f90 b/flang/test/Lower/OpenMP/wsloop-collapse.f90
index 67351ca275efbd..61ee76d5891071 100644
--- a/flang/test/Lower/OpenMP/wsloop-collapse.f90
+++ b/flang/test/Lower/OpenMP/wsloop-collapse.f90
@@ -84,7 +84,6 @@ program wsloop_collapse
!CHECK: hlfir.assign %[[VAL_42]] to %[[VAL_19]]#0 : i32, !fir.ref<i32>
!CHECK: omp.yield
!CHECK-NEXT: }
-!CHECK-NEXT: omp.terminator
x = x + i + j + k
end do
end do
diff --git a/flang/test/Lower/OpenMP/wsloop-monotonic.f90 b/flang/test/Lower/OpenMP/wsloop-monotonic.f90
index ec1b216a8695fa..9659fff2d42e7d 100644
--- a/flang/test/Lower/OpenMP/wsloop-monotonic.f90
+++ b/flang/test/Lower/OpenMP/wsloop-monotonic.f90
@@ -27,7 +27,6 @@ program wsloop_dynamic
!CHECK: fir.call @_FortranAioEndIoStatement(%[[RTBEGIN]]) {{.*}}: (!fir.ref<i8>) -> i32
end do
!CHECK: omp.yield
-!CHECK: omp.terminator
!CHECK: omp.terminator
!CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-nonmonotonic.f90 b/flang/test/Lower/OpenMP/wsloop-nonmonotonic.f90
index e011a8de1e69ed..b1bea525ff4896 100644
--- a/flang/test/Lower/OpenMP/wsloop-nonmonotonic.f90
+++ b/flang/test/Lower/OpenMP/wsloop-nonmonotonic.f90
@@ -30,7 +30,6 @@ program wsloop_dynamic
end do
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!CHECK: omp.terminator
!CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-ordered.f90 b/flang/test/Lower/OpenMP/wsloop-ordered.f90
index f4fa81c52315c8..5fa53f7b284471 100644
--- a/flang/test/Lower/OpenMP/wsloop-ordered.f90
+++ b/flang/test/Lower/OpenMP/wsloop-ordered.f90
@@ -10,7 +10,6 @@ subroutine wsloop_ordered_no_para()
! CHECK-NEXT: omp.loop_nest (%{{.*}}) : i32 = (%{{.*}}) to (%{{.*}}) inclusive step (%{{.*}}) {
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
!$omp do ordered
@@ -32,7 +31,6 @@ subroutine wsloop_ordered_with_para()
! CHECK-NEXT: omp.loop_nest (%{{.*}}) : i32 = (%{{.*}}) to (%{{.*}}) inclusive step (%{{.*}}) {
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
!$omp do ordered(1)
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-add-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-add-byref.f90
index 44fb49239eab42..c38a79191bc4ee 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-add-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-add-byref.f90
@@ -100,7 +100,6 @@
! CHECK: hlfir.assign %[[VAL_15]] to %[[VAL_12]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -144,7 +143,6 @@ subroutine simple_int_reduction
! CHECK: hlfir.assign %[[VAL_16]] to %[[VAL_12]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -187,7 +185,6 @@ subroutine simple_real_reduction
! CHECK: hlfir.assign %[[VAL_15]] to %[[VAL_12]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -230,7 +227,6 @@ subroutine simple_int_reduction_switch_order
! CHECK: hlfir.assign %[[VAL_16]] to %[[VAL_12]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -290,7 +286,6 @@ subroutine simple_real_reduction_switch_order
! CHECK: hlfir.assign %[[VAL_31]] to %[[VAL_22]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -357,7 +352,6 @@ subroutine multiple_int_reductions_same_type
! CHECK: hlfir.assign %[[VAL_34]] to %[[VAL_22]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -433,7 +427,6 @@ subroutine multiple_real_reductions_same_type
! CHECK: hlfir.assign %[[VAL_42]] to %[[VAL_27]]#0 : f64, !fir.ref<f64>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-add.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-add.f90
index d1617bc839cc87..c5278e0ef88152 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-add.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-add.f90
@@ -68,7 +68,6 @@
! CHECK: hlfir.assign %[[VAL_15]] to %[[VAL_12]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -112,7 +111,6 @@ subroutine simple_int_reduction
! CHECK: hlfir.assign %[[VAL_16]] to %[[VAL_12]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -155,7 +153,6 @@ subroutine simple_real_reduction
! CHECK: hlfir.assign %[[VAL_15]] to %[[VAL_12]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -198,7 +195,6 @@ subroutine simple_int_reduction_switch_order
! CHECK: hlfir.assign %[[VAL_16]] to %[[VAL_12]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -258,7 +254,6 @@ subroutine simple_real_reduction_switch_order
! CHECK: hlfir.assign %[[VAL_31]] to %[[VAL_22]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -325,7 +320,6 @@ subroutine multiple_int_reductions_same_type
! CHECK: hlfir.assign %[[VAL_34]] to %[[VAL_22]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -401,7 +395,6 @@ subroutine multiple_real_reductions_same_type
! CHECK: hlfir.assign %[[VAL_42]] to %[[VAL_27]]#0 : f64, !fir.ref<f64>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-allocatable-array-minmax.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-allocatable-array-minmax.f90
index 6b901bae539ff9..a49eba69ff38cc 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-allocatable-array-minmax.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-allocatable-array-minmax.f90
@@ -252,7 +252,6 @@ program reduce15
! CHECK: hlfir.destroy %[[VAL_68]] : !hlfir.expr<?xi32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
@@ -295,7 +294,6 @@ program reduce15
! CHECK: hlfir.destroy %[[VAL_100]] : !hlfir.expr<?xi32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-allocatable.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-allocatable.f90
index 66db62a36bc175..ba7aea0d96c5bb 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-allocatable.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-allocatable.f90
@@ -90,7 +90,6 @@ program reduce
! CHECK: hlfir.assign %[[VAL_17]] to %[[VAL_16]]#0 realloc : i32, !fir.ref<!fir.box<!fir.heap<i32>>>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-array-assumed-shape.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-array-assumed-shape.f90
index d881ff8c1a026a..9785f77c0e0918 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-array-assumed-shape.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-array-assumed-shape.f90
@@ -103,7 +103,6 @@ subroutine reduce(r)
! CHECK: hlfir.assign %[[VAL_18]] to %[[VAL_21]] : f64, !fir.ref<f64>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-array.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-array.f90
index afdd486c7be2a4..ea5df5a8369723 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-array.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-array.f90
@@ -99,7 +99,6 @@ program reduce
! CHECK: hlfir.assign %[[VAL_22]] to %[[VAL_25]] : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-array2.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-array2.f90
index ee77332e9b412a..9815cfa9c31508 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-array2.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-array2.f90
@@ -107,7 +107,6 @@ program reduce
! CHECK: hlfir.assign %[[VAL_30]] to %[[VAL_33]] : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-iand-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-iand-byref.f90
index 0696236e8f0736..829229807698a9 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-iand-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-iand-byref.f90
@@ -49,7 +49,6 @@
! CHECK: %[[VAL_20:.*]] = arith.andi %[[VAL_18]], %[[VAL_19]] : i32
! CHECK: hlfir.assign %[[VAL_20]] to %[[VAL_14]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-iand.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-iand.f90
index 713e50f72e9dc9..6c060f2e5292a8 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-iand.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-iand.f90
@@ -41,7 +41,6 @@
! CHECK: %[[VAL_20:.*]] = arith.andi %[[VAL_18]], %[[VAL_19]] : i32
! CHECK: hlfir.assign %[[VAL_20]] to %[[VAL_14]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-ieor-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-ieor-byref.f90
index 5b0758ac3fcc1d..284ada404bd60f 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-ieor-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-ieor-byref.f90
@@ -43,7 +43,6 @@
!CHECK: hlfir.assign %[[RES]] to %[[PRV_DECL]]#0 : i32, !fir.ref<i32>
!CHECK: omp.yield
!CHECK: omp.terminator
-!CHECK: omp.terminator
subroutine reduction_ieor(y)
integer :: x, y(:)
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-ieor.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-ieor.f90
index 958cc6f87e4f8e..e67253a413ce2d 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-ieor.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-ieor.f90
@@ -32,7 +32,6 @@
!CHECK: hlfir.assign %[[RES]] to %[[PRV_DECL]]#0 : i32, !fir.ref<i32>
!CHECK: omp.yield
!CHECK: omp.terminator
-!CHECK: omp.terminator
subroutine reduction_ieor(y)
integer :: x, y(:)
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-ior-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-ior-byref.f90
index 8604a274a659fd..315121cc7beb74 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-ior-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-ior-byref.f90
@@ -47,7 +47,6 @@
! CHECK: %[[VAL_20:.*]] = arith.ori %[[VAL_18]], %[[VAL_19]] : i32
! CHECK: hlfir.assign %[[VAL_20]] to %[[VAL_14]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-ior.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-ior.f90
index a80838047bac3f..3da250da9703de 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-ior.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-ior.f90
@@ -41,7 +41,6 @@
! CHECK: %[[VAL_20:.*]] = arith.ori %[[VAL_18]], %[[VAL_19]] : i32
! CHECK: hlfir.assign %[[VAL_20]] to %[[VAL_14]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-logical-and-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-logical-and-byref.f90
index 65072f3ccce351..30908b6bdd4ce9 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-logical-and-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-logical-and-byref.f90
@@ -59,7 +59,6 @@
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -109,7 +108,6 @@ end subroutine simple_reduction
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -190,7 +188,6 @@ subroutine simple_reduction_switch_order(y)
! CHECK: %[[VAL_56:.*]] = fir.convert %[[VAL_55]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_56]] to %[[VAL_29]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-logical-and.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-logical-and.f90
index 818e1a652064eb..367683de02080a 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-logical-and.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-logical-and.f90
@@ -51,7 +51,6 @@
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -101,7 +100,6 @@ end subroutine simple_reduction
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -182,7 +180,6 @@ subroutine simple_reduction_switch_order(y)
! CHECK: %[[VAL_56:.*]] = fir.convert %[[VAL_55]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_56]] to %[[VAL_29]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv-byref.f90
index 71d4a34da2d34b..9137dd8ff4454e 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv-byref.f90
@@ -59,7 +59,6 @@
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -108,7 +107,6 @@ subroutine simple_reduction(y)
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -189,7 +187,6 @@ subroutine simple_reduction_switch_order(y)
! CHECK: %[[VAL_56:.*]] = fir.convert %[[VAL_55]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_56]] to %[[VAL_29]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv.f90
index 926cf380b0f228..d1ef676c37407c 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv.f90
@@ -51,7 +51,6 @@
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -100,7 +99,6 @@ subroutine simple_reduction(y)
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -181,7 +179,6 @@ subroutine simple_reduction_switch_order(y)
! CHECK: %[[VAL_56:.*]] = fir.convert %[[VAL_55]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_56]] to %[[VAL_29]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv-byref.f90
index 3b7f5771b87c5b..d1491a0f5561db 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv-byref.f90
@@ -59,7 +59,6 @@
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -109,7 +108,6 @@ subroutine simple_reduction(y)
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -192,7 +190,6 @@ subroutine simple_reduction_switch_order(y)
! CHECK: %[[VAL_56:.*]] = fir.convert %[[VAL_55]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_56]] to %[[VAL_29]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv.f90
index 1a1bffad19d273..b4df699c49ffae 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv.f90
@@ -51,7 +51,6 @@
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -101,7 +100,6 @@ subroutine simple_reduction(y)
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -184,7 +182,6 @@ subroutine simple_reduction_switch_order(y)
! CHECK: %[[VAL_56:.*]] = fir.convert %[[VAL_55]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_56]] to %[[VAL_29]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-logical-or-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-logical-or-byref.f90
index 22239ea69e9808..8f4a6c22c1d747 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-logical-or-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-logical-or-byref.f90
@@ -58,7 +58,6 @@
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -107,7 +106,6 @@ subroutine simple_reduction(y)
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -188,7 +186,6 @@ subroutine simple_reduction_switch_order(y)
! CHECK: %[[VAL_56:.*]] = fir.convert %[[VAL_55]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_56]] to %[[VAL_29]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-logical-or.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-logical-or.f90
index 6bdf47bc89d647..9d367797ec216a 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-logical-or.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-logical-or.f90
@@ -51,7 +51,6 @@
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -100,7 +99,6 @@ subroutine simple_reduction(y)
! CHECK: %[[VAL_26:.*]] = fir.convert %[[VAL_25]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_26]] to %[[VAL_17]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -181,7 +179,6 @@ subroutine simple_reduction_switch_order(y)
! CHECK: %[[VAL_56:.*]] = fir.convert %[[VAL_55]] : (i1) -> !fir.logical<4>
! CHECK: hlfir.assign %[[VAL_56]] to %[[VAL_29]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-max-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-max-byref.f90
index 56a43abca42a76..9abff8ccfa3b62 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-max-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-max-byref.f90
@@ -63,7 +63,6 @@
! CHECK: %[[VAL_21:.*]] = arith.select %[[VAL_20]], %[[VAL_18]], %[[VAL_19]] : i32
! CHECK: hlfir.assign %[[VAL_21]] to %[[VAL_14]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK-LABEL: func.func @_QPreduction_max_real(
@@ -94,7 +93,6 @@
! CHECK: %[[VAL_21:.*]] = arith.select %[[VAL_20]], %[[VAL_18]], %[[VAL_19]] : f32
! CHECK: hlfir.assign %[[VAL_21]] to %[[VAL_14]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: omp.parallel {
! CHECK: %[[VAL_30:.*]] = fir.alloca i32 {bindc_name = "i", pinned, {{.*}}}
@@ -120,7 +118,6 @@
! CHECK: hlfir.assign %[[VAL_47]] to %[[VAL_37]]#0 : f32, !fir.ref<f32>
! CHECK: }
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-max.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-max.f90
index 775554fd3dcca1..7237d3f903b743 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-max.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-max.f90
@@ -53,7 +53,6 @@
! CHECK: %[[VAL_21:.*]] = arith.select %[[VAL_20]], %[[VAL_18]], %[[VAL_19]] : i32
! CHECK: hlfir.assign %[[VAL_21]] to %[[VAL_14]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK-LABEL: func.func @_QPreduction_max_real(
@@ -84,7 +83,6 @@
! CHECK: %[[VAL_21:.*]] = arith.select %[[VAL_20]], %[[VAL_18]], %[[VAL_19]] : f32
! CHECK: hlfir.assign %[[VAL_21]] to %[[VAL_14]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: omp.parallel {
! CHECK: %[[VAL_30:.*]] = fir.alloca i32 {bindc_name = "i", pinned, {{.*}}}
@@ -110,7 +108,6 @@
! CHECK: hlfir.assign %[[VAL_47]] to %[[VAL_37]]#0 : f32, !fir.ref<f32>
! CHECK: }
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-min-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-min-byref.f90
index d16de4a867a24c..a4bfbaa09d2fa9 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-min-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-min-byref.f90
@@ -63,7 +63,6 @@
! CHECK: %[[VAL_21:.*]] = arith.select %[[VAL_20]], %[[VAL_18]], %[[VAL_19]] : i32
! CHECK: hlfir.assign %[[VAL_21]] to %[[VAL_14]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK-LABEL: func.func @_QPreduction_min_real(
@@ -95,7 +94,6 @@
! CHECK: hlfir.assign %[[VAL_21]] to %[[VAL_14]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.parallel {
@@ -122,7 +120,6 @@
! CHECK: hlfir.assign %[[VAL_47]] to %[[VAL_37]]#0 : f32, !fir.ref<f32>
! CHECK: }
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-min.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-min.f90
index 04957c7287eae4..ce9e53a17523c8 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-min.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-min.f90
@@ -53,7 +53,6 @@
! CHECK: %[[VAL_21:.*]] = arith.select %[[VAL_20]], %[[VAL_18]], %[[VAL_19]] : i32
! CHECK: hlfir.assign %[[VAL_21]] to %[[VAL_14]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK-LABEL: func.func @_QPreduction_min_real(
@@ -85,7 +84,6 @@
! CHECK: hlfir.assign %[[VAL_21]] to %[[VAL_14]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.parallel {
@@ -112,7 +110,6 @@
! CHECK: hlfir.assign %[[VAL_47]] to %[[VAL_37]]#0 : f32, !fir.ref<f32>
! CHECK: }
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-min2.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-min2.f90
index 834fb03c1d14d4..d83ebb77af3ebd 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-min2.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-min2.f90
@@ -47,6 +47,5 @@ program reduce
! CHECK: hlfir.assign %[[VAL_12]] to %[[VAL_11]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-mul-byref.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-mul-byref.f90
index 04c6787ab01e0f..18554fbb72aee1 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-mul-byref.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-mul-byref.f90
@@ -102,7 +102,6 @@
! CHECK: %[[VAL_15:.*]] = arith.muli %[[VAL_13]], %[[VAL_14]] : i32
! CHECK: hlfir.assign %[[VAL_15]] to %[[VAL_12]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -141,7 +140,6 @@ subroutine simple_int_reduction
! CHECK: %[[VAL_16:.*]] = arith.mulf %[[VAL_13]], %[[VAL_15]] fastmath<contract> : f32
! CHECK: hlfir.assign %[[VAL_16]] to %[[VAL_12]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -179,7 +177,6 @@ subroutine simple_real_reduction
! CHECK: %[[VAL_15:.*]] = arith.muli %[[VAL_13]], %[[VAL_14]] : i32
! CHECK: hlfir.assign %[[VAL_15]] to %[[VAL_12]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -218,7 +215,6 @@ subroutine simple_int_reduction_switch_order
! CHECK: %[[VAL_16:.*]] = arith.mulf %[[VAL_14]], %[[VAL_15]] fastmath<contract> : f32
! CHECK: hlfir.assign %[[VAL_16]] to %[[VAL_12]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -274,7 +270,6 @@ subroutine simple_real_reduction_switch_order
! CHECK: %[[VAL_31:.*]] = arith.muli %[[VAL_29]], %[[VAL_30]] : i32
! CHECK: hlfir.assign %[[VAL_31]] to %[[VAL_22]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -337,7 +332,6 @@ subroutine multiple_int_reductions_same_type
! CHECK: %[[VAL_34:.*]] = arith.mulf %[[VAL_31]], %[[VAL_33]] fastmath<contract> : f32
! CHECK: hlfir.assign %[[VAL_34]] to %[[VAL_22]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -409,7 +403,6 @@ subroutine multiple_real_reductions_same_type
! CHECK: %[[VAL_42:.*]] = arith.mulf %[[VAL_39]], %[[VAL_41]] fastmath<contract> : f64
! CHECK: hlfir.assign %[[VAL_42]] to %[[VAL_27]]#0 : f64, !fir.ref<f64>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-mul.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-mul.f90
index d7cafb22852226..f5c12ccf61f765 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-mul.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-mul.f90
@@ -69,7 +69,6 @@
! CHECK: %[[VAL_15:.*]] = arith.muli %[[VAL_13]], %[[VAL_14]] : i32
! CHECK: hlfir.assign %[[VAL_15]] to %[[VAL_12]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -108,7 +107,6 @@ subroutine simple_int_reduction
! CHECK: %[[VAL_16:.*]] = arith.mulf %[[VAL_13]], %[[VAL_15]] fastmath<contract> : f32
! CHECK: hlfir.assign %[[VAL_16]] to %[[VAL_12]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -146,7 +144,6 @@ subroutine simple_real_reduction
! CHECK: %[[VAL_15:.*]] = arith.muli %[[VAL_13]], %[[VAL_14]] : i32
! CHECK: hlfir.assign %[[VAL_15]] to %[[VAL_12]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -185,7 +182,6 @@ subroutine simple_int_reduction_switch_order
! CHECK: %[[VAL_16:.*]] = arith.mulf %[[VAL_14]], %[[VAL_15]] fastmath<contract> : f32
! CHECK: hlfir.assign %[[VAL_16]] to %[[VAL_12]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -241,7 +237,6 @@ subroutine simple_real_reduction_switch_order
! CHECK: %[[VAL_31:.*]] = arith.muli %[[VAL_29]], %[[VAL_30]] : i32
! CHECK: hlfir.assign %[[VAL_31]] to %[[VAL_22]]#0 : i32, !fir.ref<i32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -304,7 +299,6 @@ subroutine multiple_int_reductions_same_type
! CHECK: %[[VAL_34:.*]] = arith.mulf %[[VAL_31]], %[[VAL_33]] fastmath<contract> : f32
! CHECK: hlfir.assign %[[VAL_34]] to %[[VAL_22]]#0 : f32, !fir.ref<f32>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
@@ -376,7 +370,6 @@ subroutine multiple_real_reductions_same_type
! CHECK: %[[VAL_42:.*]] = arith.mulf %[[VAL_39]], %[[VAL_41]] fastmath<contract> : f64
! CHECK: hlfir.assign %[[VAL_42]] to %[[VAL_27]]#0 : f64, !fir.ref<f64>
! CHECK: omp.yield
-! CHECK: omp.terminator
! CHECK: omp.terminator
! CHECK: return
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-multi.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-multi.f90
index 1ca8cdc622ea92..659ba060056703 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-multi.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-multi.f90
@@ -61,7 +61,6 @@
!CHECK: hlfir.assign %[[RES_Z]] to %[[PRV_Z_DECL]]#0 : i32, !fir.ref<i32>
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!CHECK: return
subroutine multiple_reduction(v)
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-multiple-clauses.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-multiple-clauses.f90
index 746229b8699f39..5b6ab095b45b65 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-multiple-clauses.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-multiple-clauses.f90
@@ -154,7 +154,6 @@ program main
! CHECK: hlfir.assign %[[VAL_44]] to %[[VAL_48]] : f64, !fir.ref<f64>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-reduction-pointer.f90 b/flang/test/Lower/OpenMP/wsloop-reduction-pointer.f90
index 8d4aa8cd830389..2c126bb8962c2b 100644
--- a/flang/test/Lower/OpenMP/wsloop-reduction-pointer.f90
+++ b/flang/test/Lower/OpenMP/wsloop-reduction-pointer.f90
@@ -106,7 +106,6 @@ program reduce_pointer
! CHECK: hlfir.assign %[[VAL_30]] to %[[VAL_32]] : i32, !fir.ptr<i32>
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-schedule.f90 b/flang/test/Lower/OpenMP/wsloop-schedule.f90
index de0a2dae6b5874..ae854a2de0c9df 100644
--- a/flang/test/Lower/OpenMP/wsloop-schedule.f90
+++ b/flang/test/Lower/OpenMP/wsloop-schedule.f90
@@ -27,7 +27,6 @@ program wsloop_dynamic
end do
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!CHECK: omp.terminator
!CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-unstructured.f90 b/flang/test/Lower/OpenMP/wsloop-unstructured.f90
index bd6a0bade8c7ee..8c89f863ab8772 100644
--- a/flang/test/Lower/OpenMP/wsloop-unstructured.f90
+++ b/flang/test/Lower/OpenMP/wsloop-unstructured.f90
@@ -54,7 +54,6 @@ end subroutine sub
! CHECK: ^bb7:
! CHECK: omp.yield
! CHECK: }
-! CHECK: omp.terminator
! CHECK: }
! CHECK: omp.terminator
! CHECK: }
diff --git a/flang/test/Lower/OpenMP/wsloop-variable.f90 b/flang/test/Lower/OpenMP/wsloop-variable.f90
index 7bfb9274f389a3..8d235c10fa1d60 100644
--- a/flang/test/Lower/OpenMP/wsloop-variable.f90
+++ b/flang/test/Lower/OpenMP/wsloop-variable.f90
@@ -35,7 +35,6 @@ program wsloop_variable
!CHECK: hlfir.assign %[[TMP11]] to %{{.*}} : f32, !fir.ref<f32>
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!$omp do collapse(2)
@@ -58,7 +57,6 @@ program wsloop_variable
!CHECK: hlfir.assign %[[TMP16]] to %{{.*}} : f32, !fir.ref<f32>
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!$omp do
@@ -79,7 +77,6 @@ program wsloop_variable
!CHECK: hlfir.assign %[[TMP21]] to %{{.*}} : f32, !fir.ref<f32>
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!$omp do
@@ -162,7 +159,6 @@ subroutine wsloop_variable_sub
!CHECK: fir.store %[[VAL_48:.*]]#1 to %[[VAL_17]]#1 : !fir.ref<i64>
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
!$omp do
@@ -193,7 +189,6 @@ subroutine wsloop_variable_sub
!CHECK: }
!CHECK: omp.yield
!CHECK: }
-!CHECK: omp.terminator
!CHECK: }
j1 = 5
!$omp do
diff --git a/flang/test/Lower/OpenMP/wsloop.f90 b/flang/test/Lower/OpenMP/wsloop.f90
index 6566b3cbd6d4d9..4378233a622ed1 100644
--- a/flang/test/Lower/OpenMP/wsloop.f90
+++ b/flang/test/Lower/OpenMP/wsloop.f90
@@ -22,7 +22,6 @@ subroutine simple_loop
print*, i
end do
! CHECK: omp.yield
- ! CHECK: omp.terminator
!$OMP END DO
! CHECK: omp.terminator
!$OMP END PARALLEL
@@ -48,7 +47,6 @@ subroutine simple_loop_with_step
print*, i
end do
! CHECK: omp.yield
- ! CHECK: omp.terminator
!$OMP END DO
! CHECK: omp.terminator
!$OMP END PARALLEL
@@ -74,7 +72,6 @@ subroutine loop_with_schedule_nowait
print*, i
end do
! CHECK: omp.yield
- ! CHECK: omp.terminator
!$OMP END DO NOWAIT
! CHECK: omp.terminator
!$OMP END PARALLEL
diff --git a/mlir/docs/Dialects/OpenMPDialect/_index.md b/mlir/docs/Dialects/OpenMPDialect/_index.md
index b4e359284edae6..3d28fe7819129f 100644
--- a/mlir/docs/Dialects/OpenMPDialect/_index.md
+++ b/mlir/docs/Dialects/OpenMPDialect/_index.md
@@ -362,9 +362,10 @@ of accessing clause-defined block arguments.
Loop-associated OpenMP constructs are represented in the dialect as loop wrapper
operations. These implement the `LoopWrapperInterface`, which enforces a series
of restrictions upon the operation:
- - It contains a single region with a single block; and
- - Its block contains exactly two operations: another loop wrapper or
-`omp.loop_nest` operation and a terminator.
+ - It has the `NoTerminator` and `SingleBlock` traits;
+ - It contains a single region; and
+ - Its only block contains exactly one operation, which must be another loop
+wrapper or `omp.loop_nest` operation.
This approach splits the representation for a loop nest and the loop-associated
constructs that specify how its iterations are executed, possibly across various
@@ -393,7 +394,6 @@ omp.parallel ... {
store %sum, %c[%i] : memref<?xf32>
omp.yield
}
- omp.terminator
}
...
omp.terminator
@@ -490,9 +490,7 @@ omp.distribute ... {
...
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
```
@@ -518,9 +516,7 @@ omp.parallel ... {
...
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
...
omp.terminator
diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
index 66f63fc02fe2f3..dd21afec6eb453 100644
--- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
@@ -364,9 +364,8 @@ def LoopNestOp : OpenMP_Op<"loop_nest", traits = [
//===----------------------------------------------------------------------===//
def WsloopOp : OpenMP_Op<"wsloop", traits = [
- AttrSizedOperandSegments,
- DeclareOpInterfaceMethods<ComposableOpInterface>,
- DeclareOpInterfaceMethods<LoopWrapperInterface>,
+ AttrSizedOperandSegments, DeclareOpInterfaceMethods<ComposableOpInterface>,
+ DeclareOpInterfaceMethods<LoopWrapperInterface>, NoTerminator,
RecursiveMemoryEffects, SingleBlock
], clauses = [
OpenMP_AllocateClause, OpenMP_LinearClause, OpenMP_NowaitClause,
@@ -381,8 +380,8 @@ def WsloopOp : OpenMP_Op<"wsloop", traits = [
parallel region.
The body region can only contain a single block which must contain a single
- operation and a terminator. The operation must be another compatible loop
- wrapper or an `omp.loop_nest`.
+ operation. This operation must be another compatible loop wrapper or an
+ `omp.loop_nest`.
```
omp.wsloop <clauses> {
@@ -393,7 +392,6 @@ def WsloopOp : OpenMP_Op<"wsloop", traits = [
store %sum, %arrC[%i1, %i2] : memref<?x?xf32>
omp.yield
}
- omp.terminator
}
```
}] # clausesDescription;
@@ -417,9 +415,8 @@ def WsloopOp : OpenMP_Op<"wsloop", traits = [
//===----------------------------------------------------------------------===//
def SimdOp : OpenMP_Op<"simd", traits = [
- AttrSizedOperandSegments,
- DeclareOpInterfaceMethods<ComposableOpInterface>,
- DeclareOpInterfaceMethods<LoopWrapperInterface>,
+ AttrSizedOperandSegments, DeclareOpInterfaceMethods<ComposableOpInterface>,
+ DeclareOpInterfaceMethods<LoopWrapperInterface>, NoTerminator,
RecursiveMemoryEffects, SingleBlock
], clauses = [
OpenMP_AlignedClause, OpenMP_IfClause, OpenMP_LinearClause,
@@ -433,8 +430,8 @@ def SimdOp : OpenMP_Op<"simd", traits = [
be executed concurrently using SIMD instructions).
The body region can only contain a single block which must contain a single
- operation and a terminator. The operation must be another compatible loop
- wrapper or an `omp.loop_nest`.
+ operation. This operation must be another compatible loop wrapper or an
+ `omp.loop_nest`.
```
omp.simd <clauses> {
@@ -445,7 +442,6 @@ def SimdOp : OpenMP_Op<"simd", traits = [
store %sum, %arrC[%i1, %i2] : memref<?x?xf32>
omp.yield
}
- omp.terminator
}
```
@@ -492,9 +488,8 @@ def YieldOp : OpenMP_Op<"yield",
// Distribute construct [2.9.4.1]
//===----------------------------------------------------------------------===//
def DistributeOp : OpenMP_Op<"distribute", traits = [
- AttrSizedOperandSegments,
- DeclareOpInterfaceMethods<ComposableOpInterface>,
- DeclareOpInterfaceMethods<LoopWrapperInterface>,
+ AttrSizedOperandSegments, DeclareOpInterfaceMethods<ComposableOpInterface>,
+ DeclareOpInterfaceMethods<LoopWrapperInterface>, NoTerminator,
RecursiveMemoryEffects, SingleBlock
], clauses = [
OpenMP_AllocateClause, OpenMP_DistScheduleClause, OpenMP_OrderClause,
@@ -517,8 +512,8 @@ def DistributeOp : OpenMP_Op<"distribute", traits = [
region.
The body region can only contain a single block which must contain a single
- operation and a terminator. The operation must be another compatible loop
- wrapper or an `omp.loop_nest`.
+ operation. This operation must be another compatible loop wrapper or an
+ `omp.loop_nest`.
```mlir
omp.distribute <clauses> {
@@ -529,7 +524,6 @@ def DistributeOp : OpenMP_Op<"distribute", traits = [
store %sum, %arrC[%i1, %i2] : memref<?x?xf32>
omp.yield
}
- omp.terminator
}
```
}] # clausesDescription;
@@ -595,7 +589,7 @@ def TaskOp : OpenMP_Op<"task", traits = [
def TaskloopOp : OpenMP_Op<"taskloop", traits = [
AttrSizedOperandSegments, AutomaticAllocationScope,
DeclareOpInterfaceMethods<ComposableOpInterface>,
- DeclareOpInterfaceMethods<LoopWrapperInterface>,
+ DeclareOpInterfaceMethods<LoopWrapperInterface>, NoTerminator,
RecursiveMemoryEffects, SingleBlock
], clauses = [
OpenMP_AllocateClause, OpenMP_FinalClause, OpenMP_GrainsizeClause,
@@ -613,8 +607,8 @@ def TaskloopOp : OpenMP_Op<"taskloop", traits = [
scheduled to be executed.
The body region can only contain a single block which must contain a single
- operation and a terminator. The operation must be another compatible loop
- wrapper or an `omp.loop_nest`.
+ operation. This operation must be another compatible loop wrapper or an
+ `omp.loop_nest`.
```
omp.taskloop <clauses> {
@@ -625,7 +619,6 @@ def TaskloopOp : OpenMP_Op<"taskloop", traits = [
store %sum, %arrC[%i1, %i2] : memref<?x?xf32>
omp.yield
}
- omp.terminator
}
```
diff --git a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
index 6d250237e0a334..aa241b91d758ca 100644
--- a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
+++ b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
@@ -488,9 +488,6 @@ struct ParallelOpLowering : public OpRewritePattern<scf::ParallelOp> {
llvm::SmallVector<mlir::Location>(reductionVariables.size(),
parallelOp.getLoc()));
- rewriter.setInsertionPoint(
- rewriter.create<omp::TerminatorOp>(parallelOp.getLoc()));
-
// Create loop nest and populate region with contents of scf.parallel.
auto loopOp = rewriter.create<omp::LoopNestOp>(
parallelOp.getLoc(), parallelOp.getLowerBound(),
diff --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
index f87a46a7e5995a..c6c6edb8f999fc 100644
--- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
@@ -1924,27 +1924,23 @@ LogicalResult SingleOp::verify() {
LogicalResult LoopWrapperInterface::verifyImpl() {
Operation *op = this->getOperation();
+ if (!op->hasTrait<OpTrait::NoTerminator>() ||
+ !op->hasTrait<OpTrait::SingleBlock>())
+ return emitOpError() << "loop wrapper must also have the `NoTerminator` "
+ "and `SingleBlock` traits";
+
if (op->getNumRegions() != 1)
- return emitOpError() << "loop wrapper contains multiple regions";
+ return emitOpError() << "loop wrapper does not contain exactly one region";
Region ®ion = op->getRegion(0);
- if (!region.hasOneBlock())
- return emitOpError() << "loop wrapper contains multiple blocks";
-
- if (::llvm::range_size(region.getOps()) != 2)
+ if (range_size(region.getOps()) != 1)
return emitOpError()
- << "loop wrapper does not contain exactly two nested ops";
+ << "loop wrapper does not contain exactly one nested op";
Operation &firstOp = *region.op_begin();
- Operation &secondOp = *(std::next(region.op_begin()));
-
- if (!secondOp.hasTrait<OpTrait::IsTerminator>())
- return emitOpError()
- << "second nested op in loop wrapper is not a terminator";
-
- if (!::llvm::isa<LoopNestOp, LoopWrapperInterface>(firstOp))
- return emitOpError() << "first nested op in loop wrapper is not "
- "another loop wrapper or `omp.loop_nest`";
+ if (!isa<LoopNestOp, LoopWrapperInterface>(firstOp))
+ return emitOpError() << "op nested in loop wrapper is not another loop "
+ "wrapper or `omp.loop_nest`";
return success();
}
diff --git a/mlir/test/CAPI/execution_engine.c b/mlir/test/CAPI/execution_engine.c
index 81ff8477ffd7b7..18120c6ec80280 100644
--- a/mlir/test/CAPI/execution_engine.c
+++ b/mlir/test/CAPI/execution_engine.c
@@ -103,7 +103,6 @@ void testOmpCreation(void) {
" omp.loop_nest (%3) : i32 = (%0) to (%2) step (%1) { \n"
" omp.yield \n"
" } \n"
-" omp.terminator \n"
" } \n"
" omp.terminator \n"
" } \n"
diff --git a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
index d914eb940e7919..e496c66f86522b 100644
--- a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
+++ b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
@@ -96,7 +96,6 @@ func.func @wsloop(%arg0: index, %arg1: index, %arg2: index, %arg3: index, %arg4:
"test.payload"(%arg6, %arg7) : (index, index) -> ()
omp.yield
}
- omp.terminator
}) : () -> ()
omp.terminator
}
@@ -189,7 +188,6 @@ func.func @loop_nest_block_arg(%val : i32, %ub : i32, %i : index) {
^bb3:
omp.yield
}
- omp.terminator
}
return
}
@@ -347,7 +345,6 @@ llvm.func @_QPsb() {
// CHECK: %[[ZEXT:.+]] = llvm.zext %[[CMP]] : i1 to i32
// CHECK: llvm.store %[[ZEXT]], %[[PRV]] : i32, !llvm.ptr
// CHECK: omp.yield
-// CHECK: omp.terminator
// CHECK: omp.terminator
// CHECK: llvm.return
@@ -389,7 +386,6 @@ llvm.func @_QPsimple_reduction(%arg0: !llvm.ptr {fir.bindc_name = "y"}) {
llvm.store %14, %prv : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -559,7 +555,6 @@ func.func @omp_distribute(%arg0 : index) -> () {
omp.loop_nest (%iv) : index = (%arg0) to (%arg0) step (%arg0) {
omp.yield
}
- omp.terminator
}
return
}
@@ -587,7 +582,6 @@ func.func @omp_ordered(%arg0 : index) -> () {
omp.ordered depend_vec(%arg0 : index) {doacross_num_loops = 1 : i64}
omp.yield
}
- omp.terminator
}
return
}
@@ -608,7 +602,6 @@ func.func @omp_taskloop(%arg0: index, %arg1 : memref<i32>) {
"test.payload"(%iv) : (index) -> ()
omp.yield
}
- omp.terminator
}
omp.terminator
}
diff --git a/mlir/test/Conversion/SCFToOpenMP/reductions.mlir b/mlir/test/Conversion/SCFToOpenMP/reductions.mlir
index fc6d56559c2618..8e2343df488773 100644
--- a/mlir/test/Conversion/SCFToOpenMP/reductions.mlir
+++ b/mlir/test/Conversion/SCFToOpenMP/reductions.mlir
@@ -44,7 +44,6 @@ func.func @reduction1(%arg0 : index, %arg1 : index, %arg2 : index,
}
// CHECK: omp.yield
}
- // CHECK: omp.terminator
// CHECK: omp.terminator
// CHECK: llvm.load %[[BUF]]
return
@@ -240,7 +239,6 @@ func.func @reduction4(%arg0 : index, %arg1 : index, %arg2 : index,
}
// CHECK: omp.yield
}
- // CHECK: omp.terminator
// CHECK: omp.terminator
// CHECK: %[[RES1:.*]] = llvm.load %[[BUF1]] : !llvm.ptr -> f32
// CHECK: %[[RES2:.*]] = llvm.load %[[BUF2]] : !llvm.ptr -> i64
diff --git a/mlir/test/Conversion/SCFToOpenMP/scf-to-openmp.mlir b/mlir/test/Conversion/SCFToOpenMP/scf-to-openmp.mlir
index b2f19d294cb5fe..a722acbf2c3471 100644
--- a/mlir/test/Conversion/SCFToOpenMP/scf-to-openmp.mlir
+++ b/mlir/test/Conversion/SCFToOpenMP/scf-to-openmp.mlir
@@ -14,7 +14,6 @@ func.func @parallel(%arg0: index, %arg1: index, %arg2: index,
// CHECK: omp.yield
// CHECK: }
}
- // CHECK: omp.terminator
// CHECK: }
// CHECK: omp.terminator
// CHECK: }
@@ -41,10 +40,8 @@ func.func @nested_loops(%arg0: index, %arg1: index, %arg2: index,
}
// CHECK: omp.yield
// CHECK: }
- // CHECK: omp.terminator
// CHECK: }
}
- // CHECK: omp.terminator
// CHECK: }
// CHECK: omp.terminator
// CHECK: }
@@ -65,7 +62,6 @@ func.func @adjacent_loops(%arg0: index, %arg1: index, %arg2: index,
// CHECK: omp.yield
// CHECK: }
}
- // CHECK: omp.terminator
// CHECK: }
// CHECK: omp.terminator
// CHECK: }
@@ -81,7 +77,6 @@ func.func @adjacent_loops(%arg0: index, %arg1: index, %arg2: index,
// CHECK: omp.yield
// CHECK: }
}
- // CHECK: omp.terminator
// CHECK: }
// CHECK: omp.terminator
// CHECK: }
diff --git a/mlir/test/Dialect/LLVMIR/legalize-for-export.mlir b/mlir/test/Dialect/LLVMIR/legalize-for-export.mlir
index b1b06740f19442..7b4557d47bde2f 100644
--- a/mlir/test/Dialect/LLVMIR/legalize-for-export.mlir
+++ b/mlir/test/Dialect/LLVMIR/legalize-for-export.mlir
@@ -42,7 +42,6 @@ llvm.func @repeated_successor_openmp(%arg0: i64, %arg1: i64, %arg2: i64, %arg3:
// CHECK: ^[[BB2]](%[[ARG:.*]]: i64):
// CHECK: llvm.br ^[[BB1]](%[[ARG]] : i64)
}
- omp.terminator
}
llvm.return
}
diff --git a/mlir/test/Dialect/OpenMP/invalid.mlir b/mlir/test/Dialect/OpenMP/invalid.mlir
index a780efe6d22e16..f7a87713aca351 100644
--- a/mlir/test/Dialect/OpenMP/invalid.mlir
+++ b/mlir/test/Dialect/OpenMP/invalid.mlir
@@ -103,7 +103,6 @@ func.func @type_mismatch(%lb : index, %ub : index, %step : index) {
^bb0(%iv2: i32):
omp.yield
}) : (index, index, index) -> ()
- omp.terminator
}
}
@@ -116,20 +115,18 @@ func.func @iv_number_mismatch(%lb : index, %ub : index, %step : index) {
^bb0(%iv1 : index, %iv2 : index):
omp.yield
}) : (index, index, index) -> ()
- omp.terminator
}
}
// -----
func.func @no_wrapper(%lb : index, %ub : index, %step : index) {
- // expected-error @below {{op loop wrapper does not contain exactly two nested ops}}
+ // expected-error @below {{op loop wrapper does not contain exactly one nested op}}
omp.wsloop {
%0 = arith.constant 0 : i32
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
}
@@ -142,9 +139,7 @@ func.func @invalid_nested_wrapper(%lb : index, %ub : index, %step : index) {
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
}
@@ -157,7 +152,6 @@ func.func @no_loops(%lb : index, %ub : index, %step : index) {
^bb0():
omp.yield
}) : () -> ()
- omp.terminator
}
}
@@ -169,7 +163,6 @@ func.func @inclusive_not_a_clause(%lb : index, %ub : index, %step : index) {
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
}
@@ -181,7 +174,6 @@ func.func @order_value(%lb : index, %ub : index, %step : index) {
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
}
@@ -192,7 +184,6 @@ func.func @reproducible_order(%lb : index, %ub : index, %step : index) {
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
}
// -----
@@ -202,7 +193,6 @@ func.func @unconstrained_order(%lb : index, %ub : index, %step : index) {
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
}
// -----
@@ -213,7 +203,6 @@ func.func @if_not_allowed(%lb : index, %ub : index, %step : index, %bool_var : i
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
}
@@ -225,7 +214,6 @@ func.func @num_threads_not_allowed(%lb : index, %ub : index, %step : index, %int
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
}
@@ -237,7 +225,6 @@ func.func @proc_bind_not_allowed(%lb : index, %ub : index, %step : index) {
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
}
@@ -249,7 +236,6 @@ llvm.func @test_omp_wsloop_dynamic_bad_modifier(%lb : i64, %ub : i64, %step : i6
omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -262,7 +248,6 @@ llvm.func @test_omp_wsloop_dynamic_many_modifier(%lb : i64, %ub : i64, %step : i
omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -275,7 +260,6 @@ llvm.func @test_omp_wsloop_dynamic_wrong_modifier(%lb : i64, %ub : i64, %step :
omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -288,7 +272,6 @@ llvm.func @test_omp_wsloop_dynamic_wrong_modifier2(%lb : i64, %ub : i64, %step :
omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -301,7 +284,6 @@ llvm.func @test_omp_wsloop_dynamic_wrong_modifier3(%lb : i64, %ub : i64, %step :
omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -309,10 +291,8 @@ llvm.func @test_omp_wsloop_dynamic_wrong_modifier3(%lb : i64, %ub : i64, %step :
// -----
func.func @omp_simd() -> () {
- // expected-error @below {{op loop wrapper does not contain exactly two nested ops}}
- omp.simd {
- omp.terminator
- }
+ // expected-error @below {{op loop wrapper does not contain exactly one nested op}}
+ omp.simd {}
return
}
@@ -325,9 +305,7 @@ func.func @omp_simd_nested_wrapper(%lb : index, %ub : index, %step : index) -> (
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
- omp.terminator
}
return
}
@@ -355,7 +333,6 @@ func.func @omp_simd_aligned_mismatch(%arg0 : index, %arg1 : index,
omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
omp.yield
}
- omp.terminator
}) {alignments = [128],
operandSegmentSizes = array<i32: 2, 0, 0, 0, 0, 0, 0>} : (memref<i32>, memref<i32>) -> ()
return
@@ -371,7 +348,6 @@ func.func @omp_simd_aligned_negative(%arg0 : index, %arg1 : index,
omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
omp.yield
}
- omp.terminator
}) {alignments = [-1, 128], operandSegmentSizes = array<i32: 2, 0, 0, 0, 0, 0, 0>} : (memref<i32>, memref<i32>) -> ()
return
}
@@ -386,7 +362,6 @@ func.func @omp_simd_unexpected_alignment(%arg0 : index, %arg1 : index,
omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
omp.yield
}
- omp.terminator
}) {alignments = [1, 128]} : () -> ()
return
}
@@ -401,7 +376,6 @@ func.func @omp_simd_aligned_float(%arg0 : index, %arg1 : index,
omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
omp.yield
}
- omp.terminator
}) {alignments = [1.5, 128], operandSegmentSizes = array<i32: 2, 0, 0, 0, 0, 0, 0>} : (memref<i32>, memref<i32>) -> ()
return
}
@@ -416,7 +390,6 @@ func.func @omp_simd_aligned_the_same_var(%arg0 : index, %arg1 : index,
omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
omp.yield
}
- omp.terminator
}) {alignments = [1, 128], operandSegmentSizes = array<i32: 2, 0, 0, 0, 0, 0, 0>} : (memref<i32>, memref<i32>) -> ()
return
}
@@ -431,7 +404,6 @@ func.func @omp_simd_nontemporal_the_same_var(%arg0 : index, %arg1 : index,
omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
omp.yield
}
- omp.terminator
}) {operandSegmentSizes = array<i32: 0, 0, 0, 0, 2, 0, 0>} : (memref<i32>, memref<i32>) -> ()
return
}
@@ -444,7 +416,6 @@ func.func @omp_simd_order_value(%lb : index, %ub : index, %step : index) {
omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
omp.yield
}
- omp.terminator
}
return
}
@@ -457,7 +428,6 @@ func.func @omp_simd_reproducible_order(%lb : index, %ub : index, %step : index)
omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
omp.yield
}
- omp.terminator
}
return
}
@@ -468,7 +438,6 @@ func.func @omp_simd_unconstrained_order(%lb : index, %ub : index, %step : index)
omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
omp.yield
}
- omp.terminator
}
return
}
@@ -479,7 +448,6 @@ func.func @omp_simd_pretty_simdlen(%lb : index, %ub : index, %step : index) -> (
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -492,7 +460,6 @@ func.func @omp_simd_pretty_safelen(%lb : index, %ub : index, %step : index) -> (
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -505,7 +472,6 @@ func.func @omp_simd_pretty_simdlen_safelen(%lb : index, %ub : index, %step : ind
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -724,7 +690,6 @@ func.func @foo(%lb : index, %ub : index, %step : index) {
%2 = arith.constant 2.0 : f32
omp.yield
}
- omp.terminator
}
return
}
@@ -753,7 +718,6 @@ func.func @foo(%lb : index, %ub : index, %step : index) {
%2 = arith.constant 2.0 : f32
omp.yield
}
- omp.terminator
}
return
}
@@ -787,7 +751,6 @@ func.func @foo(%lb : index, %ub : index, %step : index, %mem : memref<1xf32>) {
%2 = arith.constant 2.0 : f32
omp.yield
}
- omp.terminator
}
return
}
@@ -828,7 +791,6 @@ func.func @omp_ordered_region1(%x : i32) -> () {
}
omp.yield
}
- omp.terminator
}
return
}
@@ -844,7 +806,6 @@ func.func @omp_ordered_region2(%x : i32) -> () {
}
omp.yield
}
- omp.terminator
}
return
}
@@ -860,7 +821,6 @@ func.func @omp_ordered_region3(%x : i32) -> () {
}
omp.yield
}
- omp.terminator
}
return
}
@@ -882,7 +842,6 @@ func.func @omp_ordered2(%arg1 : i32, %arg2 : i32, %arg3 : i32, %vec0 : i64) -> (
omp.ordered depend_type(dependsink) depend_vec(%vec0 : i64) {doacross_num_loops = 1 : i64}
omp.yield
}
- omp.terminator
}
return
}
@@ -896,7 +855,6 @@ func.func @omp_ordered3(%arg1 : i32, %arg2 : i32, %arg3 : i32, %vec0 : i64) -> (
omp.ordered depend_type(dependsink) depend_vec(%vec0 : i64) {doacross_num_loops = 1 : i64}
omp.yield
}
- omp.terminator
}
return
}
@@ -910,7 +868,6 @@ func.func @omp_ordered4(%arg1 : i32, %arg2 : i32, %arg3 : i32, %vec0 : i64) -> (
omp.ordered depend_type(dependsink) depend_vec(%vec0 : i64) {doacross_num_loops = 1 : i64}
omp.yield
}
- omp.terminator
}
return
}
@@ -924,7 +881,6 @@ func.func @omp_ordered5(%arg1 : i32, %arg2 : i32, %arg3 : i32, %vec0 : i64, %vec
omp.ordered depend_type(dependsource) depend_vec(%vec0, %vec1 : i64, i64) {doacross_num_loops = 2 : i64}
omp.yield
}
- omp.terminator
}
return
}
@@ -1796,7 +1752,6 @@ func.func @omp_cancel3(%arg1 : i32, %arg2 : i32, %arg3 : i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
return
}
@@ -1811,7 +1766,6 @@ func.func @omp_cancel4(%arg1 : i32, %arg2 : i32, %arg3 : i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
return
}
@@ -1876,7 +1830,6 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
- omp.terminator
}) {operandSegmentSizes = array<i32: 1, 0, 0, 0, 0, 0, 0, 0, 0, 0>} : (memref<i32>) -> ()
return
}
@@ -1892,7 +1845,6 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
- omp.terminator
}) {operandSegmentSizes = array<i32: 0, 0, 0, 0, 0, 0, 0, 0, 0, 2>, reduction_syms = [@add_f32]} : (!llvm.ptr, !llvm.ptr) -> ()
return
}
@@ -1907,7 +1859,6 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
- omp.terminator
}) {operandSegmentSizes = array<i32: 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>, reduction_syms = [@add_f32, @add_f32]} : (!llvm.ptr) -> ()
return
}
@@ -1923,7 +1874,6 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
- omp.terminator
}) {in_reduction_syms = [@add_f32], operandSegmentSizes = array<i32: 0, 0, 0, 0, 0, 2, 0, 0, 0, 0>} : (!llvm.ptr, !llvm.ptr) -> ()
return
}
@@ -1938,7 +1888,6 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
- omp.terminator
}) {in_reduction_syms = [@add_f32, @add_f32], operandSegmentSizes = array<i32: 0, 0, 0, 0, 0, 1, 0, 0, 0, 0>} : (!llvm.ptr) -> ()
return
}
@@ -1965,7 +1914,6 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -1991,7 +1939,6 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -2005,7 +1952,6 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -2013,10 +1959,9 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
// -----
func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
- // expected-error @below {{op first nested op in loop wrapper is not another loop wrapper or `omp.loop_nest`}}
+ // expected-error @below {{op nested in loop wrapper is not another loop wrapper or `omp.loop_nest`}}
omp.taskloop {
%0 = arith.constant 0 : i32
- omp.terminator
}
return
}
@@ -2030,9 +1975,7 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
omp.loop_nest (%iv) : i32 = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
return
}
@@ -2209,7 +2152,6 @@ func.func @omp_distribute_schedule(%chunk_size : i32, %lb : i32, %ub : i32, %ste
omp.loop_nest (%iv) : i32 = (%lb) to (%ub) step (%step) {
"omp.yield"() : () -> ()
}
- "omp.terminator"() : () -> ()
}) : (i32) -> ()
}
@@ -2221,24 +2163,11 @@ func.func @omp_distribute_allocate(%data_var : memref<i32>, %lb : i32, %ub : i32
omp.loop_nest (%iv) : i32 = (%lb) to (%ub) step (%step) {
"omp.yield"() : () -> ()
}
- "omp.terminator"() : () -> ()
}) : (memref<i32>) -> ()
}
// -----
-func.func @omp_distribute_wrapper(%lb: index, %ub: index, %step: index) -> () {
- // expected-error @below {{op second nested op in loop wrapper is not a terminator}}
- omp.distribute {
- omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
- "omp.yield"() : () -> ()
- }
- %0 = arith.constant 0 : i32
- }
-}
-
-// -----
-
func.func @omp_distribute_nested_wrapper(%lb: index, %ub: index, %step: index) -> () {
// expected-error @below {{an 'omp.wsloop' nested wrapper is only allowed when 'omp.parallel' is the direct parent}}
omp.distribute {
@@ -2246,9 +2175,7 @@ func.func @omp_distribute_nested_wrapper(%lb: index, %ub: index, %step: index) -
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
"omp.yield"() : () -> ()
}
- "omp.terminator"() : () -> ()
}) {omp.composite} : () -> ()
- "omp.terminator"() : () -> ()
} {omp.composite}
}
@@ -2261,9 +2188,7 @@ func.func @omp_distribute_nested_wrapper2(%lb: index, %ub: index, %step: index)
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
"omp.yield"() : () -> ()
}
- "omp.terminator"() : () -> ()
}) {omp.composite} : () -> ()
- "omp.terminator"() : () -> ()
} {omp.composite}
}
@@ -2276,9 +2201,7 @@ func.func @omp_distribute_nested_wrapper3(%lb: index, %ub: index, %step: index)
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
"omp.yield"() : () -> ()
}
- "omp.terminator"() : () -> ()
}) {omp.composite} : () -> ()
- "omp.terminator"() : () -> ()
}
}
@@ -2500,9 +2423,7 @@ func.func @omp_parallel_missing_composite(%lb: index, %ub: index, %step: index)
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
omp.terminator
}
@@ -2517,7 +2438,6 @@ func.func @omp_parallel_invalid_composite(%lb: index, %ub: index, %step: index)
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
omp.terminator
} {omp.composite}
@@ -2534,9 +2454,7 @@ func.func @omp_parallel_invalid_composite2(%lb: index, %ub: index, %step: index)
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
omp.terminator
} {omp.composite}
@@ -2551,9 +2469,7 @@ func.func @omp_wsloop_missing_composite(%lb: index, %ub: index, %step: index) ->
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
}
return
}
@@ -2565,7 +2481,6 @@ func.func @omp_wsloop_invalid_composite(%lb: index, %ub: index, %step: index) ->
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
return
}
@@ -2579,9 +2494,7 @@ func.func @omp_wsloop_missing_composite_2(%lb: index, %ub: index, %step: index)
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
- omp.terminator
} {omp.composite}
omp.terminator
} {omp.composite}
@@ -2596,9 +2509,7 @@ func.func @omp_simd_missing_composite(%lb: index, %ub: index, %step: index) -> (
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
- omp.terminator
} {omp.composite}
return
}
@@ -2610,7 +2521,6 @@ func.func @omp_simd_invalid_composite(%lb: index, %ub: index, %step: index) -> (
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
return
}
@@ -2624,9 +2534,7 @@ func.func @omp_distribute_missing_composite(%lb: index, %ub: index, %step: index
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
}
omp.terminator
} {omp.composite}
@@ -2640,7 +2548,6 @@ func.func @omp_distribute_invalid_composite(%lb: index, %ub: index, %step: index
omp.loop_nest (%0) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
return
}
@@ -2653,9 +2560,7 @@ func.func @omp_taskloop_missing_composite(%lb: index, %ub: index, %step: index)
omp.loop_nest (%i) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
}
return
}
@@ -2667,7 +2572,6 @@ func.func @omp_taskloop_invalid_composite(%lb: index, %ub: index, %step: index)
omp.loop_nest (%i) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
return
}
diff --git a/mlir/test/Dialect/OpenMP/ops.mlir b/mlir/test/Dialect/OpenMP/ops.mlir
index a4423782a723bf..6f11b451fa00a3 100644
--- a/mlir/test/Dialect/OpenMP/ops.mlir
+++ b/mlir/test/Dialect/OpenMP/ops.mlir
@@ -110,9 +110,7 @@ func.func @omp_parallel(%data_var : memref<i32>, %if_cond : i1, %num_threads : i
omp.loop_nest (%iv) : index = (%idx) to (%idx) step (%idx) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
omp.terminator
} {omp.composite}
@@ -130,11 +128,8 @@ func.func @omp_parallel(%data_var : memref<i32>, %if_cond : i1, %num_threads : i
omp.loop_nest (%iv) : index = (%idx) to (%idx) step (%idx) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
omp.terminator
} {omp.composite}
@@ -197,7 +192,6 @@ func.func @omp_loop_nest(%lb : index, %ub : index, %step : index) -> () {
^bb0(%iv: index):
omp.yield
}) : (index, index, index) -> ()
- omp.terminator
}
omp.wsloop {
@@ -208,7 +202,6 @@ func.func @omp_loop_nest(%lb : index, %ub : index, %step : index) -> () {
^bb0(%iv: index):
omp.yield
}) {loop_inclusive} : (index, index, index) -> ()
- omp.terminator
}
omp.wsloop {
@@ -219,7 +212,6 @@ func.func @omp_loop_nest(%lb : index, %ub : index, %step : index) -> () {
^bb0(%iv: index, %iv3: index):
omp.yield
}) : (index, index, index, index, index, index) -> ()
- omp.terminator
}
omp.wsloop {
@@ -235,7 +227,6 @@ func.func @omp_loop_nest(%lb : index, %ub : index, %step : index) -> () {
// CHECK: omp.yield
omp.yield
}) : (index, index, index) -> ()
- omp.terminator
}
return
@@ -250,7 +241,6 @@ func.func @omp_loop_nest_pretty(%lb : index, %ub : index, %step : index) -> () {
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
omp.wsloop {
@@ -260,7 +250,6 @@ func.func @omp_loop_nest_pretty(%lb : index, %ub : index, %step : index) -> () {
omp.loop_nest (%iv) : index = (%lb) to (%ub) inclusive step (%step) {
omp.yield
}
- omp.terminator
}
omp.wsloop {
@@ -270,7 +259,6 @@ func.func @omp_loop_nest_pretty(%lb : index, %ub : index, %step : index) -> () {
omp.loop_nest (%iv1, %iv2) : index = (%lb, %lb) to (%ub, %ub) step (%step, %step) {
omp.yield
}
- omp.terminator
}
omp.wsloop {
@@ -285,7 +273,6 @@ func.func @omp_loop_nest_pretty(%lb : index, %ub : index, %step : index) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
return
@@ -304,7 +291,6 @@ func.func @omp_loop_nest_pretty_multi_block(%lb : index, %ub : index,
memref.store %arg, %data1[%iv] : memref<?xi32>
omp.yield
}
- omp.terminator
}
omp.wsloop {
@@ -322,7 +308,6 @@ func.func @omp_loop_nest_pretty_multi_block(%lb : index, %ub : index,
^bb3:
omp.yield
}
- omp.terminator
}
omp.wsloop {
@@ -338,7 +323,6 @@ func.func @omp_loop_nest_pretty_multi_block(%lb : index, %ub : index,
memref.store %arg1, %data2[%iv] : memref<?xi32>
omp.yield
}
- omp.terminator
}
return
@@ -358,7 +342,6 @@ func.func @omp_loop_nest_pretty_non_index(%lb1 : i32, %ub1 : i32, %step1 : i32,
memref.store %iv1, %data1[%arg1] : memref<?xi32>
omp.yield
}
- omp.terminator
}
omp.wsloop {
@@ -370,7 +353,6 @@ func.func @omp_loop_nest_pretty_non_index(%lb1 : i32, %ub1 : i32, %step1 : i32,
memref.store %iv, %data2[%arg2] : memref<?xi64>
omp.yield
}
- omp.terminator
}
return
@@ -389,7 +371,6 @@ func.func @omp_loop_nest_pretty_multiple(%lb1 : i32, %ub1 : i32, %step1 : i32,
memref.store %iv2, %data1[%2] : memref<?xi32>
omp.yield
}
- omp.terminator
}
return
@@ -404,7 +385,6 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}) {operandSegmentSizes = array<i32: 0,0,0,0,0,0,0>, ordered = 1} :
() -> ()
@@ -414,7 +394,6 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}) {operandSegmentSizes = array<i32: 0,0,1,1,0,0,0>, schedule_kind = #omp<schedulekind static>} :
(memref<i32>, i32) -> ()
@@ -424,7 +403,6 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}) {operandSegmentSizes = array<i32: 0,0,2,2,0,0,0>, schedule_kind = #omp<schedulekind static>} :
(memref<i32>, memref<i32>, i32, i32) -> ()
@@ -434,7 +412,6 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}) {operandSegmentSizes = array<i32: 0,0,1,1,0,0,1>, schedule_kind = #omp<schedulekind dynamic>, ordered = 2} :
(memref<i32>, i32, i32) -> ()
@@ -444,7 +421,6 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}) {operandSegmentSizes = array<i32: 0,0,0,0,0,0,0>, nowait, schedule_kind = #omp<schedulekind auto>} :
() -> ()
@@ -456,9 +432,7 @@ func.func @omp_wsloop(%lb : index, %ub : index, %step : index, %data_var : memre
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
}) {omp.composite} : () -> ()
return
@@ -473,7 +447,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop linear(%{{.*}} = %{{.*}} : memref<i32>) schedule(static) {
@@ -482,7 +455,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop linear(%{{.*}} = %{{.*}} : memref<i32>) ordered(2) schedule(static = %{{.*}} : i32) {
@@ -491,7 +463,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop linear(%{{.*}} = %{{.*}} : memref<i32>) ordered(2) schedule(dynamic = %{{.*}} : i32, nonmonotonic) {
@@ -500,7 +471,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop linear(%{{.*}} = %{{.*}} : memref<i32>) ordered(2) schedule(dynamic = %{{.*}} : i16, monotonic) {
@@ -509,7 +479,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop {
@@ -518,7 +487,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop nowait {
@@ -527,7 +495,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop nowait order(concurrent) {
@@ -536,7 +503,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop nowait order(reproducible:concurrent) {
@@ -545,7 +511,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop nowait order(unconstrained:concurrent) {
// CHECK-NEXT: omp.loop_nest
@@ -553,7 +518,6 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.wsloop {
// CHECK-NEXT: omp.simd
@@ -563,9 +527,7 @@ func.func @omp_wsloop_pretty(%lb : index, %ub : index, %step : index, %data_var
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
return
@@ -579,7 +541,6 @@ func.func @omp_simd(%lb : index, %ub : index, %step : index) -> () {
^bb1(%iv2: index):
"omp.yield"() : () -> ()
}) : (index, index, index) -> ()
- "omp.terminator"() : () -> ()
}
return
@@ -596,7 +557,6 @@ func.func @omp_simd_aligned_list(%arg0 : index, %arg1 : index, %arg2 : index,
^bb1(%iv2: index):
"omp.yield"() : () -> ()
}) : (index, index, index) -> ()
- "omp.terminator"() : () -> ()
}) {alignments = [32, 128],
operandSegmentSizes = array<i32: 2, 0, 0, 0, 0, 0, 0>} : (memref<i32>, memref<i32>) -> ()
return
@@ -611,7 +571,6 @@ func.func @omp_simd_aligned_single(%arg0 : index, %arg1 : index, %arg2 : index,
^bb1(%iv2: index):
"omp.yield"() : () -> ()
}) : (index, index, index) -> ()
- "omp.terminator"() : () -> ()
}) {alignments = [32],
operandSegmentSizes = array<i32: 1, 0, 0, 0, 0, 0, 0>} : (memref<i32>) -> ()
return
@@ -627,7 +586,6 @@ func.func @omp_simd_nontemporal_list(%arg0 : index, %arg1 : index,
^bb1(%iv2: index):
"omp.yield"() : () -> ()
}) : (index, index, index) -> ()
- "omp.terminator"() : () -> ()
}) {operandSegmentSizes = array<i32: 0, 0, 0, 0, 2, 0, 0>} : (memref<i32>, memref<i64>) -> ()
return
}
@@ -642,7 +600,6 @@ func.func @omp_simd_nontemporal_single(%arg0 : index, %arg1 : index,
^bb1(%iv2: index):
"omp.yield"() : () -> ()
}) : (index, index, index) -> ()
- "omp.terminator"() : () -> ()
}) {operandSegmentSizes = array<i32: 0, 0, 0, 0, 1, 0, 0>} : (memref<i32>) -> ()
return
}
@@ -654,7 +611,6 @@ func.func @omp_simd_pretty(%lb : index, %ub : index, %step : index) -> () {
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -670,7 +626,6 @@ func.func @omp_simd_pretty_aligned(%lb : index, %ub : index, %step : index,
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -682,7 +637,6 @@ func.func @omp_simd_pretty_if(%lb : index, %ub : index, %step : index, %if_cond
omp.loop_nest (%iv): index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -696,7 +650,6 @@ func.func @omp_simd_pretty_nontemporal(%lb : index, %ub : index, %step : index,
omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -708,21 +661,18 @@ func.func @omp_simd_pretty_order(%lb : index, %ub : index, %step : index) -> ()
omp.loop_nest (%iv): index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.simd order(reproducible:concurrent)
omp.simd order(reproducible:concurrent) {
omp.loop_nest (%iv): index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.simd order(unconstrained:concurrent)
omp.simd order(unconstrained:concurrent) {
omp.loop_nest (%iv): index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -734,7 +684,6 @@ func.func @omp_simd_pretty_simdlen(%lb : index, %ub : index, %step : index) -> (
omp.loop_nest (%iv): index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -746,7 +695,6 @@ func.func @omp_simd_pretty_safelen(%lb : index, %ub : index, %step : index) -> (
omp.loop_nest (%iv): index = (%lb) to (%ub) step (%step) {
omp.yield
}
- omp.terminator
}
return
}
@@ -759,56 +707,48 @@ func.func @omp_distribute(%chunk_size : i32, %data_var : memref<i32>, %arg0 : i3
^bb0(%iv: i32):
"omp.yield"() : () -> ()
}) : (i32, i32, i32) -> ()
- "omp.terminator"() : () -> ()
}) {} : () -> ()
// CHECK: omp.distribute
omp.distribute {
omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.distribute dist_schedule_static
omp.distribute dist_schedule_static {
omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.distribute dist_schedule_static dist_schedule_chunk_size(%{{.+}} : i32)
omp.distribute dist_schedule_static dist_schedule_chunk_size(%chunk_size : i32) {
omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.distribute order(concurrent)
omp.distribute order(concurrent) {
omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.distribute order(reproducible:concurrent)
omp.distribute order(reproducible:concurrent) {
omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.distribute order(unconstrained:concurrent)
omp.distribute order(unconstrained:concurrent) {
omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.distribute allocate(%{{.+}} : memref<i32> -> %{{.+}} : memref<i32>)
omp.distribute allocate(%data_var : memref<i32> -> %data_var : memref<i32>) {
omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
omp.yield
}
- omp.terminator
}
// CHECK: omp.distribute
omp.distribute {
@@ -816,9 +756,7 @@ func.func @omp_distribute(%chunk_size : i32, %data_var : memref<i32>, %arg0 : i3
omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
return
}
@@ -958,7 +896,6 @@ func.func @wsloop_reduction(%lb : index, %ub : index, %step : index) {
llvm.store %res, %prv : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
return
}
@@ -980,7 +917,6 @@ func.func @wsloop_reduction_byref(%lb : index, %ub : index, %step : index) {
llvm.store %res, %prv : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
return
}
@@ -1034,8 +970,6 @@ func.func @parallel_wsloop_reduction(%lb : index, %ub : index, %step : index) {
// CHECK: omp.yield
omp.yield
}
- // CHECK: omp.terminator
- omp.terminator
}
// CHECK: omp.terminator
omp.terminator
@@ -1197,7 +1131,6 @@ func.func @wsloop_reduction2(%lb : index, %ub : index, %step : index) {
memref.store %4, %prv[%2] : memref<1xf32>
omp.yield
}
- omp.terminator
}
return
}
@@ -1235,8 +1168,6 @@ func.func @parallel_wsloop_reduction2(%lb : index, %ub : index, %step : index) {
// CHECK: omp.yield
omp.yield
}
- // CHECK: omp.terminator
- omp.terminator
}
// CHECK: omp.terminator
omp.terminator
@@ -1317,7 +1248,6 @@ func.func @omp_ordered(%arg1 : i32, %arg2 : i32, %arg3 : i32,
}
omp.yield
}
- omp.terminator
}
omp.wsloop ordered(1) {
@@ -1331,7 +1261,6 @@ func.func @omp_ordered(%arg1 : i32, %arg2 : i32, %arg3 : i32,
omp.yield
}
- omp.terminator
}
omp.wsloop ordered(2) {
@@ -1345,7 +1274,6 @@ func.func @omp_ordered(%arg1 : i32, %arg2 : i32, %arg3 : i32,
omp.yield
}
- omp.terminator
}
return
@@ -2213,7 +2141,6 @@ func.func @omp_cancel_wsloop(%lb : index, %ub : index, %step : index) {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
return
}
@@ -2252,7 +2179,6 @@ func.func @omp_cancellationpoint_wsloop(%lb : index, %ub : index, %step : index)
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
return
}
@@ -2340,7 +2266,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
%testbool = "test.bool"() : () -> (i1)
@@ -2351,7 +2276,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// CHECK: omp.taskloop final(%{{[^)]+}}) {
@@ -2360,7 +2284,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// CHECK: omp.taskloop untied {
@@ -2369,7 +2292,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// CHECK: omp.taskloop mergeable {
@@ -2378,7 +2300,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
%testf32 = "test.f32"() : () -> (!llvm.ptr)
@@ -2389,7 +2310,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// Checking byref attribute for in_reduction
@@ -2399,7 +2319,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// CHECK: omp.taskloop reduction(byref @add_f32 %{{.+}} -> %{{.+}}, @add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr, !llvm.ptr) {
@@ -2408,7 +2327,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// check byref attrbute for reduction
@@ -2418,7 +2336,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// CHECK: omp.taskloop in_reduction(@add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) reduction(@add_f32 %{{.+}} -> %{{.+}} : !llvm.ptr) {
@@ -2427,7 +2344,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
%testi32 = "test.i32"() : () -> (i32)
@@ -2437,7 +2353,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
%testmemref = "test.memref"() : () -> (memref<i32>)
@@ -2447,7 +2362,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
%testi64 = "test.i64"() : () -> (i64)
@@ -2457,7 +2371,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// CHECK: omp.taskloop num_tasks(%{{[^:]+}}: i64) {
@@ -2466,7 +2379,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// CHECK: omp.taskloop nogroup {
@@ -2475,7 +2387,6 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
}
// CHECK: omp.taskloop {
@@ -2485,9 +2396,7 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
// CHECK: omp.yield
omp.yield
}
- omp.terminator
} {omp.composite}
- omp.terminator
} {omp.composite}
// CHECK: return
diff --git a/mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir b/mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir
index 360b3b0c0e60c1..649210795ff5c7 100644
--- a/mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir
@@ -18,7 +18,6 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
llvm.store %loop_cnt, %gep : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir b/mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir
index 13d34b7e58f77e..b7aecec308ef35 100644
--- a/mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir
@@ -17,7 +17,6 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
llvm.store %1, %4 : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
llvm.return
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-wsloop.mlir b/mlir/test/Target/LLVMIR/omptarget-wsloop.mlir
index ee851eaf71ac0b..e2a8d88bd181af 100644
--- a/mlir/test/Target/LLVMIR/omptarget-wsloop.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-wsloop.mlir
@@ -14,7 +14,6 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
llvm.store %loop_cnt, %gep : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -27,7 +26,6 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
omp.loop_nest (%loop_cnt) : i32 = (%loop_lb) to (%loop_ub) inclusive step (%loop_step) {
omp.yield
}
- omp.terminator
}
llvm.return
}
diff --git a/mlir/test/Target/LLVMIR/openmp-data-target-device.mlir b/mlir/test/Target/LLVMIR/openmp-data-target-device.mlir
index 3dad3e9eee60d9..717a77e61b9a11 100644
--- a/mlir/test/Target/LLVMIR/openmp-data-target-device.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-data-target-device.mlir
@@ -46,7 +46,6 @@ module attributes { } {
llvm.store %21, %30 : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
diff --git a/mlir/test/Target/LLVMIR/openmp-llvm.mlir b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
index 5d76e87472dfe4..c7ddbda8e8a921 100644
--- a/mlir/test/Target/LLVMIR/openmp-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
@@ -351,7 +351,6 @@ llvm.func @wsloop_simple(%arg0: !llvm.ptr) {
llvm.store %3, %4 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
// CHECK: call void @__kmpc_for_static_fini(ptr @[[$loc_struct]],
}) : () -> ()
omp.terminator
@@ -374,7 +373,6 @@ llvm.func @wsloop_inclusive_1(%arg0: !llvm.ptr) {
llvm.store %3, %4 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}) : () -> ()
llvm.return
}
@@ -394,7 +392,6 @@ llvm.func @wsloop_inclusive_2(%arg0: !llvm.ptr) {
llvm.store %3, %4 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}) : () -> ()
llvm.return
}
@@ -412,7 +409,6 @@ llvm.func @test_omp_wsloop_static_defchunk(%lb : i32, %ub : i32, %step : i32) ->
llvm.call @body(%iv) : (i32) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -431,7 +427,6 @@ llvm.func @test_omp_wsloop_static_1(%lb : i32, %ub : i32, %step : i32) -> () {
llvm.call @body(%iv) : (i32) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -450,7 +445,6 @@ llvm.func @test_omp_wsloop_static_2(%lb : i32, %ub : i32, %step : i32) -> () {
llvm.call @body(%iv) : (i32) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -469,7 +463,6 @@ llvm.func @test_omp_wsloop_dynamic(%lb : i64, %ub : i64, %step : i64) -> () {
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -489,7 +482,6 @@ llvm.func @test_omp_wsloop_dynamic_chunk_const(%lb : i64, %ub : i64, %step : i64
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -512,7 +504,6 @@ llvm.func @test_omp_wsloop_dynamic_chunk_var(%lb : i32, %ub : i32, %step : i32)
llvm.call @body(%iv) : (i32) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -535,7 +526,6 @@ llvm.func @test_omp_wsloop_dynamic_chunk_var2(%lb : i32, %ub : i32, %step : i32)
llvm.call @body(%iv) : (i32) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -554,7 +544,6 @@ llvm.func @test_omp_wsloop_dynamic_chunk_var3(%lb : i32, %ub : i32, %step : i32,
llvm.call @body(%iv) : (i32) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -573,7 +562,6 @@ llvm.func @test_omp_wsloop_auto(%lb : i64, %ub : i64, %step : i64) -> () {
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -592,7 +580,6 @@ llvm.func @test_omp_wsloop_runtime(%lb : i64, %ub : i64, %step : i64) -> () {
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -611,7 +598,6 @@ llvm.func @test_omp_wsloop_guided(%lb : i64, %ub : i64, %step : i64) -> () {
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -630,7 +616,6 @@ llvm.func @test_omp_wsloop_dynamic_nonmonotonic(%lb : i64, %ub : i64, %step : i6
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -649,7 +634,6 @@ llvm.func @test_omp_wsloop_dynamic_monotonic(%lb : i64, %ub : i64, %step : i64)
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -668,7 +652,6 @@ llvm.func @test_omp_wsloop_runtime_simd(%lb : i64, %ub : i64, %step : i64) -> ()
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -687,7 +670,6 @@ llvm.func @test_omp_wsloop_guided_simd(%lb : i64, %ub : i64, %step : i64) -> ()
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -706,7 +688,6 @@ llvm.func @simd_simple(%lb : i64, %ub : i64, %step : i64, %arg0: !llvm.ptr) {
llvm.store %3, %4 : f32, !llvm.ptr
omp.yield
}
- "omp.terminator"() : () -> ()
}) : () -> ()
llvm.return
@@ -746,7 +727,6 @@ llvm.func @simd_simple_multiple(%lb1 : i64, %ub1 : i64, %step1 : i64, %lb2 : i64
llvm.store %3, %5 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -770,7 +750,6 @@ llvm.func @simd_simple_multiple_simdlen(%lb1 : i64, %ub1 : i64, %step1 : i64, %l
llvm.store %3, %5 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -791,7 +770,6 @@ llvm.func @simd_simple_multiple_safelen(%lb1 : i64, %ub1 : i64, %step1 : i64, %l
llvm.store %3, %5 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -811,7 +789,6 @@ llvm.func @simd_simple_multiple_simdlen_safelen(%lb1 : i64, %ub1 : i64, %step1 :
llvm.store %3, %5 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -840,7 +817,6 @@ llvm.func @simd_if(%arg0: !llvm.ptr {fir.bindc_name = "n"}, %arg1: !llvm.ptr {fi
llvm.store %arg2, %1 : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -861,7 +837,6 @@ llvm.func @simd_order() {
llvm.store %arg0, %2 : i64, !llvm.ptr
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -885,7 +860,6 @@ llvm.func @test_omp_wsloop_ordered(%lb : i64, %ub : i64, %step : i64) -> () {
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -905,7 +879,6 @@ llvm.func @test_omp_wsloop_static_ordered(%lb : i64, %ub : i64, %step : i64) ->
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -926,7 +899,6 @@ llvm.func @test_omp_wsloop_static_chunk_ordered(%lb : i32, %ub : i32, %step : i3
llvm.call @body(%iv) : (i32) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -946,7 +918,6 @@ llvm.func @test_omp_wsloop_dynamic_ordered(%lb : i64, %ub : i64, %step : i64) ->
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -966,7 +937,6 @@ llvm.func @test_omp_wsloop_auto_ordered(%lb : i64, %ub : i64, %step : i64) -> ()
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -986,7 +956,6 @@ llvm.func @test_omp_wsloop_runtime_ordered(%lb : i64, %ub : i64, %step : i64) ->
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -1006,7 +975,6 @@ llvm.func @test_omp_wsloop_guided_ordered(%lb : i64, %ub : i64, %step : i64) ->
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -1026,7 +994,6 @@ llvm.func @test_omp_wsloop_dynamic_nonmonotonic_ordered(%lb : i64, %ub : i64, %s
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -1046,7 +1013,6 @@ llvm.func @test_omp_wsloop_dynamic_monotonic_ordered(%lb : i64, %ub : i64, %step
llvm.call @body(%iv) : (i64) -> ()
omp.yield
}
- omp.terminator
}
llvm.return
}
@@ -1223,7 +1189,6 @@ llvm.func @collapse_wsloop(
llvm.store %34, %20 : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -1286,7 +1251,6 @@ llvm.func @collapse_wsloop_dynamic(
llvm.store %34, %20 : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -1320,7 +1284,6 @@ llvm.func @omp_ordered(%arg0 : i32, %arg1 : i32, %arg2 : i32, %arg3 : i64,
}
omp.yield
}
- omp.terminator
}
omp.wsloop ordered(1) {
@@ -1341,7 +1304,6 @@ llvm.func @omp_ordered(%arg0 : i32, %arg1 : i32, %arg2 : i32, %arg3 : i64,
omp.yield
}
- omp.terminator
}
omp.wsloop ordered(2) {
@@ -1373,7 +1335,6 @@ llvm.func @omp_ordered(%arg0 : i32, %arg1 : i32, %arg2 : i32, %arg3 : i64,
omp.yield
}
- omp.terminator
}
llvm.return
@@ -2387,7 +2348,6 @@ llvm.func @repeated_successor(%arg0: i64, %arg1: i64, %arg2: i64, %arg3: i1) {
^bb1(%0: i64): // 2 preds: ^bb0, ^bb0
omp.yield
}
- omp.terminator
}
llvm.return
}
diff --git a/mlir/test/Target/LLVMIR/openmp-nested.mlir b/mlir/test/Target/LLVMIR/openmp-nested.mlir
index ce5f22f10d7dce..a5224540691f32 100644
--- a/mlir/test/Target/LLVMIR/openmp-nested.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-nested.mlir
@@ -19,7 +19,6 @@ module {
llvm.store %2, %12 : i64, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -30,7 +29,6 @@ module {
%21 = llvm.call @printf(%6, %20, %20) vararg(!llvm.func<i32 (ptr, ...)>): (!llvm.ptr, i32, i32) -> i32
omp.yield
}
- omp.terminator
}
omp.terminator
}
diff --git a/mlir/test/Target/LLVMIR/openmp-reduction.mlir b/mlir/test/Target/LLVMIR/openmp-reduction.mlir
index dcac402d5fa285..6d74a925b87b5c 100644
--- a/mlir/test/Target/LLVMIR/openmp-reduction.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-reduction.mlir
@@ -34,7 +34,6 @@ llvm.func @simple_reduction(%lb : i64, %ub : i64, %step : i64) {
llvm.store %3, %prv : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -118,7 +117,6 @@ llvm.func @reuse_declaration(%lb : i64, %ub : i64, %step : i64) {
llvm.store %6, %prv1 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -207,7 +205,6 @@ llvm.func @missing_omp_reduction(%lb : i64, %ub : i64, %step : i64) {
llvm.store %4, %prv0 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -297,7 +294,6 @@ llvm.func @double_reference(%lb : i64, %ub : i64, %step : i64) {
llvm.store %5, %prv : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -393,7 +389,6 @@ llvm.func @no_atomic(%lb : i64, %ub : i64, %step : i64) {
llvm.store %6, %prv1 : f32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
@@ -549,7 +544,6 @@ llvm.func @parallel_nested_workshare_reduction(%ub : i64) {
llvm.store %add, %prv : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
omp.terminator
}
diff --git a/mlir/test/Target/LLVMIR/openmp-wsloop-reduction-cleanup.mlir b/mlir/test/Target/LLVMIR/openmp-wsloop-reduction-cleanup.mlir
index 7726b980581fa6..1a5065fec026ea 100644
--- a/mlir/test/Target/LLVMIR/openmp-wsloop-reduction-cleanup.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-wsloop-reduction-cleanup.mlir
@@ -36,7 +36,6 @@
llvm.store %0, %arg1 : i32, !llvm.ptr
omp.yield
}
- omp.terminator
}
llvm.return
}
More information about the Mlir-commits
mailing list