================ @@ -7602,17 +7602,37 @@ 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 a domain is declared as having disjoint scopes, two memory accesses are +assumed not to alias if the they both have entries for that domain in their +`alias.scope` list and their `alias.scope` lists have no scopes in common for that +domain. Equivalently, an instruction with a set of scopes from a disjoint-scope +domain in its `alias.scope` list implicitly has all other scopes in that domain +in its `noalias` set. + Because scopes in one domain don't affect scopes in other domains, separate domains can be used to compose multiple independent noalias sets. This is used for example during inlining. As the noalias function parameters are turned into noalias scope metadata, a new domain is used every time the function is inlined. -The metadata identifying each domain is itself a list containing one or two +The metadata identifying each domain is itself a list containing two or three entries. The first entry is the name of the domain. Note that if the name is a string then it can be combined across functions and translation units. A -self-reference can be used to create globally unique domain names. A -descriptive string may optionally be provided as a second list entry. +self-reference can be used to create globally unique domain names. The second +entry is an `i1` constant that marks the domain as having disjoint scopes when +it is `true`. A descriptive string may optionally be provided as a third list +entry. + +If an alias scope domain has disjoint scopes, tagging an instruction with an +`alias.scope` within that domain implicitly tags that instruction with a +`noalias` set containing all scopes in that domain not present in the +instruction's `!alias.scope` list. This makes it unnecessary to spell out the +complement of each scope when a group of N pointers is known to be mutually +non-aliasing. ---------------- brunodf-gf wrote:
This paragraph is now half-repeating the new paragraph above. Perhaps you can integrate the two? https://github.com/llvm/llvm-project/pull/218768 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
