I've copied what was done for SROA/GlobalOpt/GlobalDCE.
Diff Detail
- Repository
- rL LLVM
Event Timeline
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. |
Not sure if the amount of change here is 'ugly' but I've addressed all the responses.
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.
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.
Please add a doxygen comment to explain what this class odes.