This is an attempt to improve the handling of noop stores that are only exposed after the removal of interfering stores. This forces removal of noops to occur last after other deletions are complete, but should otherwise have the same semantics if the loop body exits early (ie when no def or clobbers found).
Diff Detail
Event Timeline
Do you have any size/performance numbers for this? (Just trying to get a rough sense of how helpful this is.)
lib/Transforms/Scalar/DeadStoreElimination.cpp | ||
---|---|---|
1082 | Can you reorganize this somehow so you don't use make_scope_exit()? Using RAII for control flow is tricky to follow. (If can't come up with anything better, even explicitly calling the lambda would be an improvement.) |
Updated to call lambda manually, which seems like the simplest solution. Will work on some benchmark results, I don't have any offhand.
Updated to remove unnecessary isDef/isClobber check, lambda is no longer necessary.
I did some benchmarking but unfortunately I couldn't find any noticeable differences in executable size from this patch. At least, nothing in test-suite seemed to result in any changes to the compiled binaries with this patch. It seems like the situation this is addressing is probably pretty rare.
Can you reorganize this somehow so you don't use make_scope_exit()? Using RAII for control flow is tricky to follow. (If can't come up with anything better, even explicitly calling the lambda would be an improvement.)