[DebugInfo] Avoid re-ordering assignments in LCSSA
authorNabeel Omer <nabeel.omer@sony.com>
Thu, 17 Dec 2020 16:06:45 +0000 (16:06 +0000)
committerJeremy Morse <jeremy.morse@sony.com>
Thu, 17 Dec 2020 16:17:32 +0000 (16:17 +0000)
commitdf2b9a3e02ca3bd7b60af6c65571909a7d3ab317
treefc5f0a12252b1b55985571963995cc7896af812d
parentab6cb31642fdc84301b7749fdeabba324e3dbc4a
[DebugInfo] Avoid re-ordering assignments in LCSSA

The LCSSA pass makes use of a function insertDebugValuesForPHIs() to
propogate dbg.value() intrinsics to newly inserted PHI instructions. Faulty
behaviour occurs when the parent PHI of a newly inserted PHI is not the
most recent assignment to a source variable. insertDebugValuesForPHIs ends
up propagating a value that isn't the most recent assignemnt.

This change removes the call to insertDebugValuesForPHIs() from LCSSA,
preventing incorrect dbg.value intrinsics from being propagated.
Propagating variable locations between blocks will occur later, during
LiveDebugValues.

Differential Revision: https://reviews.llvm.org/D92576
llvm/lib/Transforms/Utils/LCSSA.cpp
llvm/test/Transforms/LCSSA/DontInsertDebugValuesForPHIs.ll [new file with mode: 0644]
llvm/test/Transforms/LCSSA/basictest.ll
llvm/test/Transforms/LoopIdiom/X86/left-shift-until-bittest.ll