[DebugInfo][InstrRef] Correctly update DBG_PHIs during instr scheduling
Avoid several crashes when DBG_INSTR_REF and DBG_PHI instructions are fed to the instruction scheduler. DBG_INSTR_REFs should be treated like DBG_LABELs, and just ignored for the purpose of scheduling [0]. DBG_PHIs however behave much more like DBG_VALUEs: they refer to register operands, and if some register defs get shuffled around during instruction scheduling, there's a risk that the debug instr will refer to the wrong value. There's already a facility for updating DBG_VALUEs to reflect this; add DBG_PHI to the list of instructions that it will update. [0] Suboptimal, but it's what instr scheduling does right now. Differential Revision: https://reviews.llvm.org/D106663
Loading
Please sign in to comment