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

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 09:25:52 PST 2020


hoy added a comment.

In D91576#2401926 <https://reviews.llvm.org/D91576#2401926>, @nikic wrote:

> 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}`.

If `!0` and `!1` don't share the same domain, alias.scope `{!0, !1}` and noalias `{!0}` can still be considered non-aliased, since the statement says "if for some domain, ..." ?

BTW, what does a domain stand? Does it represent a set of abstract memory locations? Thanks.


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

https://reviews.llvm.org/D91576



More information about the llvm-commits mailing list