This is an archive of the discontinued LLVM Phabricator instance.

[RS4GC] Make PointerToBase mapping be global. NFC.
ClosedPublic

Authored by skatkov on Jan 31 2022, 6:24 AM.

Details

Summary

PointerToBase is a mapping between potentially derived pointer to its base.
As soon as we are in SSA form If there is a base of derived pointer and it
is available at def of derived pointer, the same base will be available at any
point where derived pointer is alive.

So the mapping of derived pointer to base pointer is a global property, not
a property of a call site.

Diff Detail

Event Timeline

skatkov created this revision.Jan 31 2022, 6:24 AM
skatkov requested review of this revision.Jan 31 2022, 6:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2022, 6:24 AM
skatkov edited the summary of this revision. (Show Details)Jan 31 2022, 6:26 AM
reames accepted this revision.Jan 31 2022, 11:20 AM

LGTM, though can you update the commit comment not to call this "global"? That generally makes me thing global variable (i.e. static at TU level), not global to the function.

Once this lands, I think there might be some further cleanup available. But that can be done lazily as needed.

I'm somewhat shaking my head that we never noticed the reuse potential before. Thanks!

This revision is now accepted and ready to land.Jan 31 2022, 11:20 AM
This revision was landed with ongoing or failed builds.Jan 31 2022, 8:48 PM
This revision was automatically updated to reflect the committed changes.