-
Notifications
You must be signed in to change notification settings - Fork 11.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Flang][OpenMP] Remove omp.simd reduction block args #111523
Conversation
This patch reverts previous changes to create entry block arguments for reduction variables attached to `simd` constructs. This can't currently be done because reduction variables stored in the corresponding clause structure are not added to the `omp.simd` operation when created, as this is not supported yet. Adding block arguments for non-existent reduction variables results in some tests from the Fujitsu compiler testsuite breaking: https://linaro.atlassian.net/browse/LLVM-1389.
@llvm/pr-subscribers-flang-fir-hlfir Author: Sergio Afonso (skatrak) ChangesThis patch reverts previous changes to create entry block arguments for reduction variables attached to This can't currently be done because reduction variables stored in the corresponding clause structure are not added to the Full diff: https://github.com/llvm/llvm-project/pull/111523.diff 1 Files Affected:
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index b1a10960c8022e..1ce744457160b4 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -2072,9 +2072,7 @@ static void genStandaloneSimd(lower::AbstractConverter &converter,
loopNestClauseOps, iv);
EntryBlockArgs simdArgs;
- // TODO: Add private syms and vars.
- simdArgs.reduction.syms = simdReductionSyms;
- simdArgs.reduction.vars = simdClauseOps.reductionVars;
+ // TODO: Add private, reduction syms and vars.
auto simdOp =
genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
@@ -2232,9 +2230,7 @@ static void genCompositeDistributeParallelDoSimd(
wsloopOp.setComposite(/*val=*/true);
EntryBlockArgs simdArgs;
- // TODO: Add private syms and vars.
- simdArgs.reduction.syms = simdReductionSyms;
- simdArgs.reduction.vars = simdClauseOps.reductionVars;
+ // TODO: Add private, reduction syms and vars.
auto simdOp =
genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
simdOp.setComposite(/*val=*/true);
@@ -2291,9 +2287,7 @@ static void genCompositeDistributeSimd(lower::AbstractConverter &converter,
distributeOp.setComposite(/*val=*/true);
EntryBlockArgs simdArgs;
- // TODO: Add private syms and vars.
- simdArgs.reduction.syms = simdReductionSyms;
- simdArgs.reduction.vars = simdClauseOps.reductionVars;
+ // TODO: Add private, reduction syms and vars.
auto simdOp =
genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
simdOp.setComposite(/*val=*/true);
@@ -2350,9 +2344,7 @@ static void genCompositeDoSimd(lower::AbstractConverter &converter,
wsloopOp.setComposite(/*val=*/true);
EntryBlockArgs simdArgs;
- // TODO: Add private syms and vars.
- simdArgs.reduction.syms = simdReductionSyms;
- simdArgs.reduction.vars = simdClauseOps.reductionVars;
+ // TODO: Add private, reduction syms and vars.
auto simdOp =
genWrapperOp<mlir::omp::SimdOp>(converter, loc, simdClauseOps, simdArgs);
simdOp.setComposite(/*val=*/true);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with you merging this to fix the test runner but I have some questions.
Why did adding block arguments break some tests? Do we have a broken index calculation somewhere returning the wrong block arguments?
Why do we get this far with an unsupported clause? Shouldn't it have a TODO?
If you check the builder for
I'm not sure, my guess is to let |
I'll merge this for now, but we can keep discussing to figure out a longer term solution. |
This patch reverts previous changes to create entry block arguments for reduction variables attached to
simd
constructs.This can't currently be done because reduction variables stored in the corresponding clause structure are not added to the
omp.simd
operation when created, as this is not supported yet. Adding block arguments for non-existent reduction variables results in some tests from the Fujitsu compiler testsuite breaking: https://linaro.atlassian.net/browse/LLVM-1389.