[Mlir-commits] [flang] [mlir] [MLIR][OpenMP] Remove terminators from loop wrappers (PR #112229)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Oct 14 09:05:28 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-openmp

Author: Sergio Afonso (skatrak)

<details>
<summary>Changes</summary>

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.

---

Patch is 132.72 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/112229.diff


84 Files Affected:

- (modified) flang/lib/Lower/OpenMP/DataSharingProcessor.cpp (+11-12) 
- (modified) flang/lib/Lower/OpenMP/OpenMP.cpp (-3) 
- (modified) flang/test/Fir/convert-to-llvm-openmp-and-fir.fir (-10) 
- (modified) flang/test/Lower/OpenMP/Todo/omp-default-clause-inner-loop.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/copyin.f90 (-2) 
- (modified) flang/test/Lower/OpenMP/default-clause-byref.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/default-clause.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/hlfir-wsloop.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/lastprivate-commonblock.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/lastprivate-iv.f90 (-2) 
- (modified) flang/test/Lower/OpenMP/location.f90 (+5-6) 
- (modified) flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90 (-6) 
- (modified) flang/test/Lower/OpenMP/parallel-private-clause-fixes.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/parallel-private-clause.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/parallel-reduction-allocatable-array.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/parallel-reduction-pointer-array.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/parallel-reduction3.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/parallel-wsloop-firstpriv.f90 (-2) 
- (modified) flang/test/Lower/OpenMP/parallel-wsloop-lastpriv.f90 (-4) 
- (modified) flang/test/Lower/OpenMP/parallel-wsloop.f90 (-8) 
- (modified) flang/test/Lower/OpenMP/private-derived-type.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/simd.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/stop-stmt-in-region.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/target.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/unstructured.f90 (-7) 
- (modified) flang/test/Lower/OpenMP/wsloop-chunks.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-collapse.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-monotonic.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-nonmonotonic.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-ordered.f90 (-2) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-add-byref.f90 (-7) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-add.f90 (-7) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-allocatable-array-minmax.f90 (-2) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-allocatable.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-array-assumed-shape.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-array.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-array2.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-iand-byref.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-iand.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-ieor-byref.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-ieor.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-ior-byref.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-ior.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-logical-and-byref.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-logical-and.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv-byref.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv-byref.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-logical-or-byref.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-logical-or.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-max-byref.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-max.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-min-byref.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-min.f90 (-3) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-min2.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-mul-byref.f90 (-7) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-mul.f90 (-7) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-multi.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-multiple-clauses.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-reduction-pointer.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-schedule.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-unstructured.f90 (-1) 
- (modified) flang/test/Lower/OpenMP/wsloop-variable.f90 (-5) 
- (modified) flang/test/Lower/OpenMP/wsloop.f90 (-3) 
- (modified) mlir/docs/Dialects/OpenMPDialect/_index.md (+4-8) 
- (modified) mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td (+15-22) 
- (modified) mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp (-3) 
- (modified) mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp (+11-15) 
- (modified) mlir/test/CAPI/execution_engine.c (-1) 
- (modified) mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir (-7) 
- (modified) mlir/test/Conversion/SCFToOpenMP/reductions.mlir (-2) 
- (modified) mlir/test/Conversion/SCFToOpenMP/scf-to-openmp.mlir (-5) 
- (modified) mlir/test/Dialect/LLVMIR/legalize-for-export.mlir (-1) 
- (modified) mlir/test/Dialect/OpenMP/invalid.mlir (+4-100) 
- (modified) mlir/test/Dialect/OpenMP/ops.mlir (-91) 
- (modified) mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir (-1) 
- (modified) mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir (-1) 
- (modified) mlir/test/Target/LLVMIR/omptarget-wsloop.mlir (-2) 
- (modified) mlir/test/Target/LLVMIR/openmp-data-target-device.mlir (-1) 
- (modified) mlir/test/Target/LLVMIR/openmp-llvm.mlir (-40) 
- (modified) mlir/test/Target/LLVMIR/openmp-nested.mlir (-2) 
- (modified) mlir/test/Target/LLVMIR/openmp-reduction.mlir (-6) 
- (modified) mlir/test/Target/LLVMIR/openmp-wsloop-reduction-cleanup.mlir (-1) 


``````````diff
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_2...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/112229


More information about the Mlir-commits mailing list