This is an archive of the discontinued LLVM Phabricator instance.

[SROA] Teach promote to register about droppable instructions
ClosedPublic

Authored by jdoerfert on Jul 16 2020, 12:11 PM.

Details

Summary

This is the second of two patches to address PR46753. We basically allow
SROA to promote allocas that are used in doppable instructions, for
now that means llvm.assume. The (transitive) uses are replaced by
undef in the droppable instructions.

See also D83976.

Diff Detail

Event Timeline

jdoerfert created this revision.Jul 16 2020, 12:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2020, 12:11 PM
Tyker added inline comments.Jul 16 2020, 12:25 PM
llvm/lib/Transforms/Scalar/SROA.cpp
3094

Use proper function to drop uses

jdoerfert updated this revision to Diff 278964.Jul 17 2020, 7:53 PM

Rebase on top of D84085

Tyker accepted this revision.Jul 20 2020, 11:26 AM

just one nit

llvm/lib/Transforms/Scalar/SROA.cpp
3094

using dropDroppableUses this way is a bit weird since it is already doing a traversal through the uses but it is correct.

maybe an API to drop a single use would be appropriate.

This revision is now accepted and ready to land.Jul 20 2020, 11:26 AM

Use explicit API call