[PATCH] D72631: [DSE] Eliminate stores at the end of the function.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 14 16:04:37 PST 2020
fhahn added a comment.
In D72631#1820660 <https://reviews.llvm.org/D72631#1820660>, @asbirlea wrote:
> Just a general comment here: DSE shouldn't necessarily make all optimizations possible. This one looks like it should be caught by DCE. If it's not, perhaps it would be good to improve DCE. Alternatively, if it's cheap enough, add a comment that it's still worth adding it to DSE.
Agreed! I tried to structured the patches to match the current functionality of DSE though, to make it easier to compare statistics between both implementations to double check we get the desired results.
Currently I think neither DCE nor ADCE would eliminate the cases covered with this patch, as they don't reason about memory accesses. To eliminate a MemoryDef at 'the end of the function', we have to prove that there are no clobbering reads between the MemoryDef and the function exit. With reworking to bottom-up, I think it might make sense to restructure the code in this patch too: only collect MemoryDefs potentially at 'the end' of a function in the main elimination loop and then afterwards do a bottom-up walk starting at the end nodes, eliminating the applicable MemoryDefs.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72631/new/
https://reviews.llvm.org/D72631
More information about the llvm-commits
mailing list