This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Drop the access group and alias strings (NFC).
Needs ReviewPublic

Authored by gysit on Mar 2 2023, 11:18 PM.



Drop the access group and alias analysis attribute related
strings that should be obsolete now that the attributes
can be accessed using the AccessGroupOpInterface
or the AliasAnalysisOpInterface.

Diff Detail

Event Timeline

gysit created this revision.Mar 2 2023, 11:18 PM
Herald added a project: Restricted Project. · View Herald Transcript
gysit requested review of this revision.Mar 2 2023, 11:18 PM
gysit added a subscriber: frgossen.

@frgossen I believe now that there are interfaces to access both access groups and all the alias analysis attributes it may time to remove the strings?

Could you share a reference use of these interfaces? I'm not very familiar with this myself, just remember that it broke our tests last time.

gysit added a comment.Mar 3 2023, 7:02 AM

Sure for setting an alias related attribute you can for example do:

auto iface = dyn_cast<AliasAnalysisOpInterface>(op);
if (!iface)
  return failure();

iface.setAliasScopes(/* put the alias scope attribute here */);

If you want to read an alias scopes this can be done as follows:

AliasAnalysisOpInterface op = loadOp;
ArrayAttr aliasRefs = op.getAliasScopesOrNull();

The access groups can be accessed using the AccessGroupOpInterface.

There is no hurry with this PR and keeping the strings is fine worst case. The interfaces are much nicer though since some error handling can be dropped (e.g.

The interface definitions are here: