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

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 28 06:58:54 PST 2021


kiranchandramohan added a comment.

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



================
Comment at: flang/lib/Semantics/resolve-directives.cpp:349
+        CheckMultipleAppearances(
+            *name, *name->symbol, Symbol::Flag::OmpReduction);
+      }
----------------
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?


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