The revision replaces the existing access group operations by
attributes. The access group operations are currently stored in a
global metadata operation. This solution is problematic when inlining
since the access groups cannot be modified in parallel - the
inliner splits the call graph into strongly connected components and
inlines them in parallel - resulting in possible race conditions.
The revision introduces an access group attribute that uses an
integer identifier to model the semantics of distinct metadata.
A distinct sequence attribute is used to generate the unique
identifiers for a specific function. Having a sequence generator
per function ensures deterministic identifiers can be generated
even if functions are manipulated in parallel.
Example:
llvm.metadata @metadata {
llvm.access_group @group llvm.return
}
llvm.store %0, %ptr { access_groups = [@metadata::@group] }
translates to:
#sequence = #llvm.distinct_sequence<scope = @foo, state = 1>
#group = #llvm.access_group<id = 0, elem_of = #sequence>
llvm.store %0, %ptr { access_groups = [#group] }
Depends on D148007