[PATCH] D93039: Introduce llvm.noalias.decl intrinsic

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 9 07:44:38 PST 2021


jeroen.dobbelaere added a comment.

In D93039#2487142 <https://reviews.llvm.org/D93039#2487142>, @nikic wrote:

> In D93039#2486994 <https://reviews.llvm.org/D93039#2486994>, @jeroen.dobbelaere wrote:
>
>> Another observation/question I have is about possible optimizations for omitting the `@llvm.experimental.noalias.scope.decl`: In the full restrict patches, the declarations are thrown away when there are no users any more. The equivalent with the implementation here, is that we can throw away the declaration if the scope it declares is not used in any `!alias.scope` metadata. Would this be something that is easy (and fast) to check ?
>
> As far as I can tell metadata does not have use lists, so I don't think this can be done without a full scan of the function to collect used scopes.

Any optimization pass where we could piggy back on to do this ? Or should something like this be a separate pass ? We would need to trace all !noalias/!alias.scope usages in  a function and combine this data with the llvm.experimental.noalias.scope.decl calls.


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

https://reviews.llvm.org/D93039



More information about the llvm-commits mailing list