aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2021-11-03 15:45:24 +0000
committerJay Foad <jay.foad@amd.com>2021-11-09 09:24:21 +0000
commit5c3c7adf3a320b2f30bf4b8d86c626d94ae2aafa (patch)
treed2c0d4f1739118f597e8aa1c94f91f4758695c0f /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
parent1c81941f192a252da2930a224428734c22c0cda1 (diff)
downloadllvm-5c3c7adf3a320b2f30bf4b8d86c626d94ae2aafa.zip
llvm-5c3c7adf3a320b2f30bf4b8d86c626d94ae2aafa.tar.gz
llvm-5c3c7adf3a320b2f30bf4b8d86c626d94ae2aafa.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index ca7d7e9..07e7082 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -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));