[PATCH] D136218: [DSE] Sink a memory access if it is only alive in one successor.
luxufan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 24 23:26:39 PST 2022
StephenFan added a comment.
In D136218#3881225 <https://reviews.llvm.org/D136218#3881225>, @pcwalton wrote:
> This is great! A couple of things I noticed on my test case:
>
> 1. This doesn't handle the case in which you might sink a store into a basic block that reads it (in my test case, it's a throwing instruction), because the check for readers will kick in and return `None` from `getDomMemoryDef()` before ever getting to check whether it can sink the store. I guess to fix this we could track reading instructions, instead of bailing out immediately, and see if they are all inside or dominated by `SuccToSinkTo`. If so, we should be able to safely sink the store, I think?
>
> 2. This doesn't handle the slow CFG search that kicks in if there are unreachable instructions. We could presumably detect sink targets there too.
>
> Both of these things could be followups of course. :)
I don't get the point of your second suggestion, do you mind giving a test case? :)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136218/new/
https://reviews.llvm.org/D136218
More information about the llvm-commits
mailing list