[all-commits] [llvm/llvm-project] ec9da5: [DebugInfo][InstrRef] Correctly update DBG_PHIs du...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Tue Jul 27 07:13:28 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec9da5172491413f098af7cd5b5bc5d1c8b9f07d
      https://github.com/llvm/llvm-project/commit/ec9da5172491413f098af7cd5b5bc5d1c8b9f07d
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-07-27 (Tue, 27 Jul 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/AntiDepBreaker.h
    M llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
    M llvm/test/CodeGen/X86/post-ra-sched-with-debug.mir

  Log Message:
  -----------
  [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




More information about the All-commits mailing list