Skip to content

[Flang][OpenMP] Process reduction only once for parallel do #70844

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

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

kiranchandramohan
Copy link
Contributor

No description provided.

@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir flang:openmp labels Oct 31, 2023
Copy link
Member

@skatrak skatrak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for catching this, I didn't realize there were exceptions in the standard as to which leaf constructs in a combined construct should get the reduction clause applied to. It says the following (v5.2, Sect. 17.2):

The effect of the reduction clause is as if it is applied to all leaf constructs that permit the clause, except for the following constructs:

  • The parallel construct, when combined with the sections, worksharing-loop, loop, or taskloop construct [...]

So I guess we can later refine the check a bit to only avoid processing the reduction clause in these specific cases. But for now I think this is good enough.

@kiranchandramohan kiranchandramohan merged commit cace715 into llvm:main Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:fir-hlfir flang:openmp flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants