[PATCH] D68510: [PATCH 27/38] [noalias] Clone scopes and llvm.noalias.decl when unrolling.

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 02:06:15 PDT 2020


jeroen.dobbelaere added a comment.

In D68510#1945043 <https://reviews.llvm.org/D68510#1945043>, @marksl wrote:

> I assume that a similar fix would then be necessary for loop peeling (and any such loop optimization that clones blocks).


Yes. Whenever a body that contains a restrict declaration (llvm.noalias.decl), care must be taken to handle the associated noalias scope in a correct way:

- when the cloning is done because of 'unrolling' (or peeling), the scopes associated to those declarations must be made unique (aka, each iteration has its own scope)
  - As D68511 <https://reviews.llvm.org/D68511> shows, loop rotation is more complicated, as only parts of a body are duplicated..
- when the cloning is done for efficiency of different code paths (loop unswitching could be a good example here), both versions can (re)use the same scope.
  - Note: it would also be valid to uniquify them, but it is not needed for correctness.


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

https://reviews.llvm.org/D68510





More information about the llvm-commits mailing list