This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP] Provide an error when the minus operator is used in a reduction
ClosedPublic

Authored by kiranchandramohan on Aug 17 2022, 11:48 AM.

Details

Summary

OpenMP 5.2 standard has deprecated the usage of the minus operation in
reductions. The minus operation also is an unpleasant feature with
varied interpretations.

The patch also changes the usage of the minus operator in some existing testcases.

Discussed in https://discourse.llvm.org/t/openmp-runtime-problem-with-subtraction-reduction/64404

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
kiranchandramohan requested review of this revision.Aug 17 2022, 11:48 AM
peixin requested changes to this revision.Aug 17 2022, 6:14 PM

Can you add one test case of declare reduction with minus operator?

flang/lib/Semantics/check-omp-structure.cpp
1936

There should be one break here to skip double error msgs.

This revision now requires changes to proceed.Aug 17 2022, 6:14 PM

Add break following the minus operator case. Update testcase.

peixin accepted this revision.Aug 18 2022, 5:43 AM

LGTM

This revision is now accepted and ready to land.Aug 18 2022, 5:43 AM
kiranchandramohan marked an inline comment as done.Aug 18 2022, 5:44 AM

Can you add one test case of declare reduction with minus operator?

There is some issue with parsing/semantics for declare reduction. I have filed an issue https://github.com/llvm/llvm-project/issues/57219.

Shall we go ahead with this for now?

Can you add one test case of declare reduction with minus operator?

There is some issue with parsing/semantics for declare reduction. I have filed an issue https://github.com/llvm/llvm-project/issues/57219.

Shall we go ahead with this for now?

Yes. I saw that issue. Please land this.

flang/lib/Semantics/check-omp-structure.cpp