Skip to content

Commit 991e042

Browse files
committed
Reuse loop op lowering, add comment.
1 parent 6da33a4 commit 991e042

File tree

2 files changed

+2
-37
lines changed

2 files changed

+2
-37
lines changed

flang/include/flang/Parser/parse-tree.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5026,6 +5026,7 @@ struct OpenMPLoopConstruct {
50265026
OpenMPLoopConstruct(OmpBeginLoopDirective &&a)
50275027
: t({std::move(a), std::nullopt, std::nullopt, std::nullopt}) {}
50285028
std::tuple<OmpBeginLoopDirective, std::optional<DoConstruct>,
5029+
// Inner loop construct used to handle tiling for now.
50295030
std::optional<common::Indirection<OpenMPLoopConstruct>>,
50305031
std::optional<OmpEndLoopDirective>>
50315032
t;

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,42 +2170,6 @@ genLoopOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
21702170
return loopOp;
21712171
}
21722172

2173-
static mlir::omp::LoopOp genTiledLoopOp(lower::AbstractConverter &converter,
2174-
lower::SymMap &symTable,
2175-
semantics::SemanticsContext &semaCtx,
2176-
lower::pft::Evaluation &eval,
2177-
mlir::Location loc,
2178-
const ConstructQueue &queue,
2179-
ConstructQueue::const_iterator item) {
2180-
mlir::omp::LoopOperands loopClauseOps;
2181-
llvm::SmallVector<const semantics::Symbol *> loopReductionSyms;
2182-
genLoopClauses(converter, semaCtx, item->clauses, loc, loopClauseOps,
2183-
loopReductionSyms);
2184-
2185-
DataSharingProcessor dsp(converter, semaCtx, item->clauses, eval,
2186-
/*shouldCollectPreDeterminedSymbols=*/true,
2187-
/*useDelayedPrivatization=*/true, symTable);
2188-
dsp.processStep1(&loopClauseOps);
2189-
2190-
mlir::omp::LoopNestOperands loopNestClauseOps;
2191-
llvm::SmallVector<const semantics::Symbol *> iv;
2192-
genLoopNestClauses(converter, semaCtx, eval, item->clauses, loc,
2193-
loopNestClauseOps, iv);
2194-
2195-
EntryBlockArgs loopArgs;
2196-
loopArgs.priv.syms = dsp.getDelayedPrivSymbols();
2197-
loopArgs.priv.vars = loopClauseOps.privateVars;
2198-
loopArgs.reduction.syms = loopReductionSyms;
2199-
loopArgs.reduction.vars = loopClauseOps.reductionVars;
2200-
2201-
auto loopOp =
2202-
genWrapperOp<mlir::omp::LoopOp>(converter, loc, loopClauseOps, loopArgs);
2203-
genLoopNestOp(converter, symTable, semaCtx, eval, loc, queue, item,
2204-
loopNestClauseOps, iv, {{loopOp, loopArgs}},
2205-
llvm::omp::Directive::OMPD_loop, dsp);
2206-
return loopOp;
2207-
}
2208-
22092173
static mlir::omp::MaskedOp
22102174
genMaskedOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
22112175
lower::StatementContext &stmtCtx,
@@ -3686,7 +3650,7 @@ static void genOMPDispatch(lower::AbstractConverter &converter,
36863650
break;
36873651
case llvm::omp::Directive::OMPD_tile:
36883652
newOp =
3689-
genTiledLoopOp(converter, symTable, semaCtx, eval, loc, queue, item);
3653+
genLoopOp(converter, symTable, semaCtx, eval, loc, queue, item);
36903654
break;
36913655
case llvm::omp::Directive::OMPD_unroll: {
36923656
unsigned version = semaCtx.langOptions().OpenMPVersion;

0 commit comments

Comments
 (0)