[PATCH] D112313: [DSE] Optimize defining access of defs while walking upwards.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 06:33:34 PDT 2021


fhahn marked an inline comment as done.
fhahn added a comment.

In D112313#3099064 <https://reviews.llvm.org/D112313#3099064>, @nikic wrote:

> In D112313#3088714 <https://reviews.llvm.org/D112313#3088714>, @fhahn wrote:
>
>> In D112313#3085784 <https://reviews.llvm.org/D112313#3085784>, @nikic wrote:
>>
>>> Conversely, if another pass runs after DSE and uses the caching walker, it will now return the access optimized by DSE, but will it always be the same as the one produced by the walker?
>>
>> I *think* the patch should only set the optimized access *if* we hit a 'guaranteed' write-clobber, so this should be the 'nearest' dominating write-clobber. It intentionally does not set the optimized access for mem-phis or non-aliasing writes. I think this should be consistent with the walker as we only set the optimized access if it could not be skipped by the walker. That is modulo differences in the AA interpretation used between the walker and `isOverwrite`.
>
> Right. For example DSE uses the earliest escape analysis, so it may find and cache a better (i.e. more dominating) clobber than the walker usually would.

Good point, I should have said 'at least as good' compared to most uses of the walkers, depending on the AA the walker uses.

> Maybe it's okay. Would be great for @asbirlea to chime in.

That would be great, as this seems a fundamental question when interacting with MemSSA, i.e. how passes should or shouldn't optimize MemorySSA as they go along.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112313/new/

https://reviews.llvm.org/D112313



More information about the llvm-commits mailing list