forked from OSchip/llvm-project
[CodeGen] Fix assertion failure in TwoAddressInstructionPass::rescheduleMIBelowKill
This fixes an assertion failure with -early-live-intervals when trying to update the live intervals for a debug instruction, which don't even have slot indexes. Differential Revision: https://reviews.llvm.org/D113116
This commit is contained in:
parent
1c81941f19
commit
5c3c7adf3a
|
@ -955,12 +955,13 @@ bool TwoAddressInstructionPass::rescheduleMIBelowKill(
|
|||
nmi = End;
|
||||
MachineBasicBlock::iterator InsertPos = KillPos;
|
||||
if (LIS) {
|
||||
// We have to move the copies first so that the MBB is still well-formed
|
||||
// when calling handleMove().
|
||||
// We have to move the copies (and any interleaved debug instructions)
|
||||
// first so that the MBB is still well-formed when calling handleMove().
|
||||
for (MachineBasicBlock::iterator MBBI = AfterMI; MBBI != End;) {
|
||||
auto CopyMI = MBBI++;
|
||||
MBB->splice(InsertPos, MBB, CopyMI);
|
||||
LIS->handleMove(*CopyMI);
|
||||
if (!CopyMI->isDebugOrPseudoInstr())
|
||||
LIS->handleMove(*CopyMI);
|
||||
InsertPos = CopyMI;
|
||||
}
|
||||
End = std::next(MachineBasicBlock::iterator(MI));
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
--- |
|
||||
; REQUIRES: asserts
|
||||
; RUN: llc -start-before=phi-node-elimination -stop-after=machinelicm -debug-only=machinelicm -o - %s | FileCheck %s
|
||||
; RUN: llc -start-before=phi-node-elimination -stop-after=machinelicm -debug-only=machinelicm -early-live-intervals -o - %s | FileCheck %s
|
||||
; Ensure we execute machinelicm post register allocation.
|
||||
; Line numbers should not be retained when loop invariant instructions are hoisted.
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue