[PATCH] D101494: [SimplifyCFG] Ignore ephemeral values when counting insts for threading

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 10:30:57 PDT 2021


tejohnson added a comment.

In D101494#2726080 <https://reviews.llvm.org/D101494#2726080>, @lebedev.ri wrote:

> In D101494#2726074 <https://reviews.llvm.org/D101494#2726074>, @nikic wrote:
>
>> Unless I'm missing something, this has a cache invalidation issue and will likely lead to non-deterministic builds. Say you have a dead block with an assume, which gets added to ephemeral values. Then that block and the instructions in it are removed. Now EphValues contains dangling pointers. Then new instructions get allocated and reuse the same memory. Now EphValues claims that values are ephemeral that aren't ephemeral.
>
> It's basically the same problem we have/had with `LoopHeaders`, yep.

Ah, thanks for pointing that out. I see there is a loop scoped collectEphemeralValues, is that how it was solved for LoopHeaders? I should probably just add a BB scoped collectEphemeralValues and use it in BlockIsSimpleEnoughToThreadThrough. That would avoid this issue and also avoid the need to pass it around.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101494



More information about the llvm-commits mailing list