This is an archive of the discontinued LLVM Phabricator instance.

[AA] Do not track Must in ModRefInfo
ClosedPublic

Authored by nikic on Jul 28 2022, 8:51 AM.

Details

Summary

getModRefInfo() queries currently track whether the result is a MustAlias on a best-effort basis. The only user of this functionality is the optimized memory access type in MemorySSA -- which in turn has no users. Given that this functionality has not found a user since it was introduced five years ago (in D38862), I think we should consider dropping it again.

The context is that I'm working to separate FunctionModRefBehavior to track mod/ref for different location kinds (like argmem or inaccessiblemem) separately, and the fact that ModRefInfo also has an unrelated Must flag makes this quite awkward, especially as this means that NoModRef is not a zero value. If we want to retain the functionality, I would probably split ModRefInfo into a part that just contains the ModRef information, and a separate part tracking the Must flag.

Diff Detail

Event Timeline

nikic created this revision.Jul 28 2022, 8:51 AM
nikic requested review of this revision.Jul 28 2022, 8:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2022, 8:51 AM

I'm all for tracking on a more fine granular scope. I'd suggest an RFC and discussion about that, maybe we get enough support to do it right rather this time. It pops up again and again anyway.
Wrt. must alias, I don't think it's worth keeping if we don't use it.

nikic updated this revision to Diff 448534.Jul 29 2022, 12:35 AM

Remove more dead code in AAEval.

I'm all for tracking on a more fine granular scope. I'd suggest an RFC and discussion about that, maybe we get enough support to do it right rather this time. It pops up again and again anyway.
Wrt. must alias, I don't think it's worth keeping if we don't use it.

Right. I want to do some internal refactoring in AA first, but ultimately we need to change how we represent memory effects in IR attributes as well.

asbirlea accepted this revision.Jul 29 2022, 12:01 PM

This is unfortunate, but your point is valid. If there hasn't been a use case so far in the passes that use MemorySSA, this cleanup makes sense.
If a use case does show up in the future we can discuss how re-adding Must info will look then, after your changes.

This revision is now accepted and ready to land.Jul 29 2022, 12:01 PM
This revision was landed with ongoing or failed builds.Jul 31 2022, 10:18 PM
This revision was automatically updated to reflect the committed changes.