HomePhabricator

[DebugInfo] Don't salvage load operations (PR40628).

Description

[DebugInfo] Don't salvage load operations (PR40628).

Salvaging a redundant load instruction into a debug expression hides a
memory read from optimisation passes. Passes that alter memory behaviour
(such as LICM promoting memory to a register) aren't aware of these debug
memory reads and leave them unaltered, making the debug variable location
point somewhere unsafe.

Teaching passes to know about these debug memory reads would be challenging
and probably incomplete. Finding dbg.value instructions that need to be fixed
would likely be computationally expensive too, as more analysis would be
required. It's better to not generate debug-memory-reads instead, alas.

Changed tests:

  • DeadStoreElim: test for salvaging of intermediate operations contributing to the dead store, instead of salvaging of the redundant load,
  • GVN: remove debuginfo behaviour checks completely, this behaviour is still covered by other tests,
  • InstCombine: don't test for salvaged loads, we're removing that behaviour.

Differential Revision: https://reviews.llvm.org/D57962

Details

Committed
jmorseTue, Feb 12, 2:54 AM
Differential Revision
D57962: [DebugInfo] PR40628: Don't salvage load operations
Parents
rL353823: [DebugInfo] Keep parameter DBG_VALUEs before prologue code
Branches
Unknown
Tags
Unknown