[PATCH] D71267: [OpenMPIRBuilder] Add support for generating kmpc_for_static_fini

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 11:11:59 PDT 2020


jdoerfert added inline comments.


================
Comment at: llvm/include/llvm/Frontend/OpenMP/OMPConstants.h:92
+bool isOpenMPLoopDirective(Directive DKind);
+
 } // end namespace omp
----------------
kiranchandramohan wrote:
> jdoerfert wrote:
> > kiranchandramohan wrote:
> > > jdoerfert wrote:
> > > > Where is the definition for these?
> > > Good catch. These are in the OMPConstants.cpp file. But i guess we do not want that file.
> > > 
> > > So we can generate these from the tablegen and remove their declaration here and in OMPConstants.cpp. Is that the right approach?
> > I think the tablegen way is good *if* we can make it nice. If not, we can keep the constants.cpp.
> > Nice would be, for example, if we generate the `isOpenMPNestingDistributeDirective` by checking if the directive name starts with `distribute`. `isOpenMPDistributeDirective` is similar, `isOpenMPLoopDirective` will probably require a flag in the directives, though that seems ok and useful either way.
> > 
> > WDYT?
> I was thinking of having these functions as properties and in each directive we can say whether this directive has the property. The property can also be classified (if necessary) as conjunctive or disjunctive and based on that we can generate the function.
> Looping through all the directives we can generate these functions. Example given below.
> 
> def isOpenMPLoopDirective : Property {
>    let type = Disjunctive;
> }
> 
> def OMP_TaskLoop : Directive<"taskloop"> {
>   let allowedClauses = [
>     ...
>   ];
>   let properties = [isOpenMPLoopDirective];
>   ...
> }
> 
> def OMP_For : Directive<"for"> {
>   let allowedClauses = [
>     ...
>   ];
>   let properties = [isOpenMPLoopDirective];
> }
That looks reasonable to me


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

https://reviews.llvm.org/D71267



More information about the llvm-commits mailing list