[PATCH] D48808: [CodeGen] Emit parallel_loop_access for each loop in the loop stack.

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 2 11:00:37 PDT 2018


hfinkel added a comment.

In https://reviews.llvm.org/D48808#1149828, @Meinersbur wrote:

> In https://reviews.llvm.org/D48808#1149549, @hfinkel wrote:
>
> > In https://reviews.llvm.org/D48808#1149534, @ABataev wrote:
> >
> > >
> >
> >
> > Michael, can you please add a test with two inner loops, one where more than one is annotated, and one where only the outer loop is annotated? It's not clear to me that I->setMetadata will do the right thing here in the former case.
>
>
> The test case `pragma-loop-safety-nested.cpp` check the case where the outer loop is annotated.
>
> Iterating over `Active` will iterate from outer to inner loops, meaning `I->setMetadata` will overwrite the annotation of the outermost loop (which IMHO is the most useful behaviour). Since it not possible to add multiple `!llvm.mem.parallel_loop_access` annotation, we cannot annotate multiple loops.


We specifically defined the metadata to support nested loops. The LangRef says, "The llvm.mem.parallel_loop_access metadata refers to a loop identifier, or metadata containing a list of loop identifiers for nested loops." To handle nested loops, we need to make the instruction metadata point to a list of loop IDs.


Repository:
  rC Clang

https://reviews.llvm.org/D48808





More information about the cfe-commits mailing list