[PATCH] D90697: [Flang][OpenMP 4.5] Add semantic check for OpenMP Reduction Clause

Yashaswini Hegde via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 08:53:46 PST 2021


yhegde marked 5 inline comments as done.
yhegde added a comment.

In D90697#2592760 <https://reviews.llvm.org/D90697#2592760>, @kiranchandramohan wrote:

> There are a few comments not marked as done. Are these not done or have been just not marked done?

I believe I have addressed all the issues raised. Hence marking them as done except question type remarks.



================
Comment at: flang/lib/Semantics/resolve-directives.cpp:349
+        CheckMultipleAppearances(
+            *name, *name->symbol, Symbol::Flag::OmpReduction);
+      }
----------------
kiranchandramohan wrote:
> yhegde wrote:
> > yhegde wrote:
> > > kiranchandramohan wrote:
> > > > yhegde wrote:
> > > > > kiranchandramohan wrote:
> > > > > > yhegde wrote:
> > > > > > > kiranchandramohan wrote:
> > > > > > > > Where was the symbol created for these names?
> > > > > > > Not sure I understood this question.  I think here symbols are created with IntrinsicOperators. 
> > > > > > I saw symbols created for the reduction operation above but not for the variable.
> > > > > The symbols were not created for ProcedureDesignator. So they were created here. And I think all other symbols associated with reduction are created along with IntrinsicOperators .
> > > > OK. Is there a test_symbols.sh test which checks for the symbol for non-Intrinsic reduction?
> > > I suppose , you mean the following test cases ?
> > > 
> > > !$omp do reduction(-:k) reduction(*:j) reduction(-:l)
> > >   !DEF: /omp_reduction/Block7/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
> > >   do i=1,10
> > >     !REF: /omp_reduction/k
> > >     k = k+1
> > >   end do
> > >   !$omp end do
> > > 
> > > 
> > >   !$omp do reduction(.and.:k) reduction(.or.:j) reduction(.eqv.:l)
> > >   !DEF: /omp_reduction/Block8/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
> > >   do i=1,10
> > >     !REF: /omp_reduction/k
> > >     k = k+1
> > >   end do
> > >   !$omp end do
> > >   
> > > I can add them. 
> > Or if the cases similar to the following case are, those under consideration ,
> > 
> > program red
> > !$omp sections reduction(&:k) reduction(#:j)
> > do i = 1, 10
> >   k = k + 1
> > end do
> > !$omp end sections
> > end program red
> > 
> > then the test_symbols.sh is catching them. 
> For the example with  loop induction variable "i" and reduction variable "k", the example you show above only contains the OmpPrivate attribute for the loop induction variable "i", it does not show anything for the reduction variable "k". Shouldn't it show OmpReduction for the reduction variables? And shouldn't it be checked?
Thank you @kiranchandramohan for the review comments. Sorry for the delayed response. Thanks for pointing out the above issue. Calling ResolveOmpObjectList() will resolve this issue. However the recent commits giving some error . Working on that. Will update the patch soon. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90697/new/

https://reviews.llvm.org/D90697



More information about the llvm-commits mailing list