[PATCH] D91576: [MemCpyOpt] Bail on call slot optimization if it merges alias scopes

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 00:52:40 PST 2020


nikic added a comment.

In D91576#2401162 <https://reviews.llvm.org/D91576#2401162>, @hoy wrote:

> 



>> Adding extra scopes to `alias.scope` should always be conservatively correct
>
> That is also my understanding, but per https://llvm.org/docs/LangRef.html#noalias-and-alias-scope-metadata, in particular this statement:
>
>   "When evaluating an aliasing query, if for some domain, the set of scopes with that domain in one instruction’s alias.scope list is a subset of (or equal to) the set of scopes for that domain in another instruction’s noalias list, then the two memory accesses are assumed not to alias.
>
> , if the extra scopes being added meet the condition above, a no-alias answer could be given. This doesn't sound conservative to me. Please correct me if I miss anything.

Note the "is a subset" requirement. If you add more scopes to the list, then the list is a subset of strictly less noalias scope lists. `{!0}` is a subset of `{!0}`, but `{!0, !1}` is not a subset of `{!0}`.


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

https://reviews.llvm.org/D91576



More information about the llvm-commits mailing list