This is an archive of the discontinued LLVM Phabricator instance.

[MemorySSA] Don't bail on phi starting access
ClosedPublic

Authored by nikic on Mar 12 2021, 2:12 PM.

Details

Summary

When calling getClobberingMemoryAccess() with MemoryLocation on a MemoryPHI starting access, the walker currently immediately bails and returns the starting access. This makes sense for the API that does not accept a location (as we wouldn't know what clobber we should be checking for), but doesn't make sense for the MemoryLocation-based API. This means that it can't look through a MemoryPHI if it's the starting access, but can if there is one more non-clobbering def in between. This patch removes the limitation.

Diff Detail

Event Timeline

nikic created this revision.Mar 12 2021, 2:12 PM
nikic requested review of this revision.Mar 12 2021, 2:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2021, 2:12 PM
nikic added inline comments.Mar 12 2021, 2:15 PM
llvm/lib/Analysis/MemorySSA.cpp
2405

The code previously fetched the defining access for MemoryUses, but imho this doesn't make sense for this API, which accepts a defining access as the starting point, unlike the other one.

asbirlea accepted this revision.Mar 12 2021, 5:11 PM

Your point is valid and the patch looks good.

This revision is now accepted and ready to land.Mar 12 2021, 5:11 PM
This revision was landed with ongoing or failed builds.Mar 13 2021, 1:59 AM
This revision was automatically updated to reflect the committed changes.