This is an archive of the discontinued LLVM Phabricator instance.

[SROA][Mem2Reg] Do not crash on alloca + addrspacecast
ClosedPublic

Authored by jdoerfert on Jul 17 2020, 7:53 PM.

Details

Summary

SROA knows that it can look through addrspacecast but
PromoteMemoryToRegister did not handle them. This caused an assertion
error for the test case, exposed while running
Transforms/PhaseOrdering/inlining-alignment-assumptions.ll with D83978
applied.

Diff Detail

Event Timeline

jdoerfert created this revision.Jul 17 2020, 7:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2020, 7:53 PM
arsenm added inline comments.Jul 18 2020, 6:35 AM
llvm/test/Transforms/SROA/alloca_addrspace.ll
2–3 ↗(On Diff #278963)

This is also covered by SROA tests, should this go in test/Mem2Reg

20 ↗(On Diff #278963)

Also could use a negative case

jdoerfert updated this revision to Diff 279035.Jul 18 2020, 4:33 PM

Split test and merge the SROA part into existing test case

arsenm accepted this revision.Jul 19 2020, 9:45 AM
This revision is now accepted and ready to land.Jul 19 2020, 9:45 AM
This revision was automatically updated to reflect the committed changes.