Skip to content

Commit a968d1f

Browse files
committed
[Flang][OpenMP] Disable lowering of omp.simd reductions in composites
Cherry-pick llvm#112686.
1 parent 64a50b8 commit a968d1f

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,6 +2716,12 @@ static void genCompositeDistributeParallelDoSimd(
27162716
genSimdClauses(converter, semaCtx, simdItem->clauses, loc, simdClauseOps,
27172717
simdReductionSyms);
27182718

2719+
// TODO: Remove this after omp.simd reductions on composite constructs are
2720+
// supported.
2721+
simdClauseOps.reductionVars.clear();
2722+
simdClauseOps.reductionByref.clear();
2723+
simdClauseOps.reductionSyms.clear();
2724+
27192725
mlir::omp::LoopNestOperands loopNestClauseOps;
27202726
llvm::SmallVector<const semantics::Symbol *> iv;
27212727
genLoopNestClauses(converter, semaCtx, eval, simdItem->clauses, loc,
@@ -2737,9 +2743,7 @@ static void genCompositeDistributeParallelDoSimd(
27372743
wsloopOp.setComposite(/*val=*/true);
27382744

27392745
EntryBlockArgs simdArgs;
2740-
// TODO: Add private syms and vars.
2741-
simdArgs.reduction.syms = simdReductionSyms;
2742-
simdArgs.reduction.vars = simdClauseOps.reductionVars;
2746+
// TODO: Add private and reduction syms and vars.
27432747
auto simdOp =
27442748
genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
27452749
simdOp.setComposite(/*val=*/true);
@@ -2833,6 +2837,12 @@ static void genCompositeDoSimd(lower::AbstractConverter &converter,
28332837
genSimdClauses(converter, semaCtx, simdItem->clauses, loc, simdClauseOps,
28342838
simdReductionSyms);
28352839

2840+
// TODO: Remove this after omp.simd reductions on composite constructs are
2841+
// supported.
2842+
simdClauseOps.reductionVars.clear();
2843+
simdClauseOps.reductionByref.clear();
2844+
simdClauseOps.reductionSyms.clear();
2845+
28362846
// TODO: Support delayed privatization.
28372847
DataSharingProcessor dsp(converter, semaCtx, simdItem->clauses, eval,
28382848
/*shouldCollectPreDeterminedSymbols=*/true,
@@ -2857,9 +2867,7 @@ static void genCompositeDoSimd(lower::AbstractConverter &converter,
28572867
wsloopOp.setComposite(/*val=*/true);
28582868

28592869
EntryBlockArgs simdArgs;
2860-
// TODO: Add private syms and vars.
2861-
simdArgs.reduction.syms = simdReductionSyms;
2862-
simdArgs.reduction.vars = simdClauseOps.reductionVars;
2870+
// TODO: Add private and reduction syms and vars.
28632871
auto simdOp =
28642872
genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
28652873
simdOp.setComposite(/*val=*/true);

0 commit comments

Comments
 (0)