[llvm-commits] [cfe-commits] [PATCH] First OpenMP patch

Hal Finkel hfinkel at anl.gov
Thu Nov 22 12:23:39 PST 2012


----- Original Message -----
> From: "Mahesha HS" <mahesha.llvm at gmail.com>
> To: "Hal Finkel" <hfinkel at anl.gov>, "Dmitri Gribenko" <gribozavr at gmail.com>
> Cc: "llvm-commits" <llvm-commits at cs.uiuc.edu>, "Joey Gouly" <joey.gouly at arm.com>, "Benjamin Kramer"
> <benny.kra at gmail.com>
> Sent: Wednesday, November 21, 2012 11:52:39 PM
> Subject: Re: [cfe-commits] [PATCH] First OpenMP patch
> 
> That is fine. I will experiment with GCC for different flags like -W,
> -Wall etc. And make sure that the implementation is in compatible
> with
> GCC (when it is not really a bug-to-bug compatible). I think, this
> additional implementation will be on top of what the current patch
> contains. This, I will send as an another patch.

Makes sense.

> 
> Do you guys agree to the internal requirement for two lang options -
> OpenMP and NoOpenMP - to keep track of the options -fopenmp and
> -fno-openmp? If so, I will change the "comment and test case" as
> mentioned by Joey and re-submit the patch.

If the only purpose of this is to affect the warnings, then Dmitri's suggestion of using something like -Wsource-uses-openmp is (in my opinion) better.

Thanks again,
Hal

> 
> --
> mahesha
> 
> 
> 
> 
> 
> On Thu, Nov 22, 2012 at 2:09 AM, Hal Finkel <hfinkel at anl.gov> wrote:
> > ----- Original Message -----
> >> From: "Dmitri Gribenko" <gribozavr at gmail.com>
> >> To: "Mahesha HS" <mahesha.llvm at gmail.com>
> >> Cc: "Benjamin Kramer" <benny.kra at gmail.com>, "llvm cfe"
> >> <cfe-commits at cs.uiuc.edu>
> >> Sent: Wednesday, November 21, 2012 11:06:50 AM
> >> Subject: Re: [cfe-commits] [PATCH] First OpenMP patch
> >>
> >> On Wed, Nov 21, 2012 at 6:02 PM, Mahesha HS
> >> <mahesha.llvm at gmail.com>
> >> wrote:
> >> > Though -fopenmp and -fno-openmp are mutually exclusive options,
> >> > underlying functionality, that we intended to implement differ a
> >> > little. In a nutshell, we, sometime back discussed in CFE DEV
> >> > list
> >> > to
> >> > implement OpenMP as follows. We thought that passing neither
> >> > -fopenmp
> >> > nor -fno-openmp  is not same as passing only -fno-openmp.
> >> >  Following
> >> > is the intended implementation. This forced me to add two lang
> >> > options
> >> > as I could not handle it using only one lang option. If this was
> >> > not
> >> > there, I guess, all your comments would not have araised.
> >> >
> >> > if (source contains OpenMP statements) {
> >> >      if (neither -fopenmp nor -fno-openmp present) {
> >> >          Throw warning.
> >> >      }
> >> >      else if (only -fopenmp present) {
> >> >          Process OpenMP
> >> >      }
> >> >      else if (only -fno-openmp) {
> >> >         Silently ignore OpenMP. Do not throw warning.
> >> >      }
> >> >     else if (both -fopenmp and -fno-openmp are present) {
> >> >         Decide based on which one appears later in the command
> >> >         line.
> >> >     }
> >> > }
> >>
> >> I think the implementation should use the general diagnostics
> >> infrastructure.  For example, by default add something like
> >> -Wsource-uses-openmp and disable it in case of -fno-openmp.
> >>
> >> $ g++ -W -Wall /tmp/zzz.cc
> >> /tmp/zzz.cc:3:0: warning: ignoring #pragma omp barrier
> >> [-Wunknown-pragmas]
> >>
> >> By the way, the algorithm above is not consistent with gcc, which
> >> ignores the pragma when no -f flag is passed.
> >
> > I think that we'd like to act the way that gcc does, except that we
> > don't want to warn about unused OpenMP pragmas when -fno-openmp is
> > given even if -Wall is also specified.
> >
> >  -Hal
> >
> >>
> >> Dmitri
> >>
> >> --
> >> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> >> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
> >> _______________________________________________
> >> cfe-commits mailing list
> >> cfe-commits at cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >>
> >
> > --
> > Hal Finkel
> > Postdoctoral Appointee
> > Leadership Computing Facility
> > Argonne National Laboratory
> 
> 
> 
> --
> mahesha
> 

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list