[flang] [compiler-rt] [clang] [llvm] [clang-tools-extra] [Flang][OpenMP] Restructure recursive lowering in `createBodyOfOp` (PR #77761)
Kiran Chandramohan via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 18 10:11:52 PST 2024
================
@@ -2186,11 +2178,43 @@ static void createBodyOfOp(
const llvm::SmallVector<const Fortran::semantics::Symbol *> &args = {},
bool outerCombined = false, DataSharingProcessor *dsp = nullptr) {
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder();
+
+ auto insertMarker = [](fir::FirOpBuilder &builder) {
+ mlir::Value undef = builder.create<fir::UndefOp>(builder.getUnknownLoc(),
+ builder.getIndexType());
+ return undef.getDefiningOp();
+ };
+
+ // Find the block where the OMP terminator should go. In simple cases
+ // it is the single block in the operation's region. When the region
+ // is more complicated, especially with unstructured control flow, there
+ // may be multiple blocks, and some of them may have non-OMP terminators
+ // resulting from lowering of the code contained within the operation.
+ // By OpenMP rules, there should be a single exit point from the region:
+ // here exit means transfering control to the code following the operation.
+ // STOP statement is allowed and does not count as exit for the purpose of
----------------
kiranchandramohan wrote:
Where is the STOP statement accounted for here? The code here looks like find the block without a terminator and assert that there is only ONE.
https://github.com/llvm/llvm-project/pull/77761
More information about the cfe-commits
mailing list