Revert 30e8f80fd5a4 "[DebugInfo] Don't create multiple DBG_VALUEs when sinking"
authorHans Wennborg <hans@chromium.org>
Tue, 10 Dec 2019 18:09:24 +0000 (19:09 +0100)
committerHans Wennborg <hans@chromium.org>
Tue, 10 Dec 2019 18:20:11 +0000 (19:20 +0100)
commit49da20ddb4319f3f469499e341a1bc3101adcdcf
tree21a798c4d6ee7f816ef166318db9ffb6771cd667
parent6515c524b0ae50dd5bb052558afa8c81d3a75780
Revert 30e8f80fd5a4 "[DebugInfo] Don't create multiple DBG_VALUEs when sinking"

This caused non-determinism in the compiler, see command on the Phabricator
code review.

> This patch addresses a performance problem reported in PR43855, and
> present in the reapplication in in 001574938e5. It turns out that
> MachineSink will (often) move instructions to the first block that
> post-dominates the current block, and then try to sink further. This
> means if we have a lot of conditionals, we can needlessly create large
> numbers of DBG_VALUEs, one in each block the sunk instruction passes
> through.
>
> To fix this, rather than immediately sinking DBG_VALUEs, record them in
> a pass structure. When sinking is complete and instructions won't be
> sunk any further, new DBG_VALUEs are added, avoiding lots of
> intermediate DBG_VALUE $noregs being created.
>
> Differential revision: https://reviews.llvm.org/D70676
llvm/lib/CodeGen/MachineSink.cpp
llvm/test/DebugInfo/MIR/X86/machinesink.mir