This is an archive of the discontinued LLVM Phabricator instance.

[SROA] Allow SROA on pointers with invariant group intrinsic uses
ClosedPublic

Authored by aeubanks on Apr 1 2021, 12:32 PM.

Details

Summary

When we are able to SROA an alloca, we know all uses of it, meaning we
don't have to preserve the invariant group intrinsics and metadata.

It's possible that we could lose information regarding redundant
loads/stores, but that's unlikely to have any real impact since right
now the only user is Clang and vtables.

Diff Detail

Event Timeline

aeubanks created this revision.Apr 1 2021, 12:32 PM
aeubanks requested review of this revision.Apr 1 2021, 12:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2021, 12:32 PM
rnk accepted this revision.Apr 1 2021, 1:42 PM

lgtm

Part of me thinks we really ought to add an integration test to Clang for this. However, I found it difficult to construct a program that SROA fails to optimize that the follow-up MemorySSA passes can't optimize without SROA, so maybe it would be too fragile.

This revision is now accepted and ready to land.Apr 1 2021, 1:42 PM
This revision was landed with ongoing or failed builds.Apr 5 2021, 7:59 PM
This revision was automatically updated to reflect the committed changes.