This is an archive of the discontinued LLVM Phabricator instance.

[PM] Port DSE to the new pass manager.
ClosedPublic

Authored by JakeVanAdrighem on May 10 2016, 6:13 PM.

Details

Summary

I've copied what was done for SROA/GlobalOpt/GlobalDCE.

Diff Detail

Repository
rL LLVM

Event Timeline

JakeVanAdrighem retitled this revision from to [PM] Port DSE to the new pass manager..
JakeVanAdrighem updated this object.
JakeVanAdrighem set the repository for this revision to rL LLVM.
JakeVanAdrighem added a subscriber: llvm-commits.
davide edited edge metadata.May 10 2016, 7:06 PM

this looks fine to me, modulo nits.

include/llvm/Transforms/Scalar/DeadStoreElimination.h
38

Please add a doxygen comment to explain what this class odes.

58

I think this should be a FunctionPass instead of a BasicBlockPass?

lib/Passes/PassRegistry.def
112

Can you call it DSEPass() for consistency with DCE and others?

include/llvm/Transforms/Scalar/DeadStoreElimination.h
58

DSE is a FunctionPass but the implementation works per BasicBlock.

JakeVanAdrighem edited edge metadata.

Not sure if the amount of change here is 'ugly' but I've addressed all the responses.

JakeVanAdrighem updated this revision to Diff 57280.EditedMay 13 2016, 7:38 PM
JakeVanAdrighem marked 3 inline comments as done.

Pull out all the member functions to be helpers. The diff here is less clean but this is just because the helpers needed to be moved around.

JakeVanAdrighem marked an inline comment as done.

Rename runOnBasicBlock to eliminateDeadStores. Add an overload that takes a Function instead of BasicBlock. Made all the helpers static. Cleaned up function description comments. clang-format.

I considered discarding this patch and splitting it out but at this point I'd rather leave it as a slight refactor + port to the new PM.

davide accepted this revision.May 19 2016, 9:48 AM
davide edited edge metadata.
This revision is now accepted and ready to land.May 19 2016, 9:48 AM
davide closed this revision.May 19 2016, 9:48 AM