[PATCH] D48808: [CodeGen] Emit parallel_loop_access for each loop in the loop stack.
Michael Kruse via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 2 10:46:47 PDT 2018
Meinersbur added a comment.
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.
More information about the cfe-commits