[PATCH] D113116: [CodeGen] Fix assertion failure in TwoAddressInstructionPass::rescheduleMIBelowKill
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 3 08:47:56 PDT 2021
foad created this revision.
foad added reviewers: MatzeB, qcolombet, craig.topper, RKSimon.
Herald added subscribers: mstorsjo, asbirlea, hiraditya.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This fixes an assertion failure with -early-live-intervals when trying
to update the live intervals for a dbug instruction, which don't even
have slot indexes.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113116
Files:
llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
llvm/test/DebugInfo/MIR/X86/mlicm-hoist-post-regalloc.mir
Index: llvm/test/DebugInfo/MIR/X86/mlicm-hoist-post-regalloc.mir
===================================================================
--- llvm/test/DebugInfo/MIR/X86/mlicm-hoist-post-regalloc.mir
+++ llvm/test/DebugInfo/MIR/X86/mlicm-hoist-post-regalloc.mir
@@ -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.
;
Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
===================================================================
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -960,7 +960,8 @@
for (MachineBasicBlock::iterator MBBI = AfterMI; MBBI != End;) {
auto CopyMI = MBBI++;
MBB->splice(InsertPos, MBB, CopyMI);
- LIS->handleMove(*CopyMI);
+ if (!CopyMI->isDebugInstr())
+ LIS->handleMove(*CopyMI);
InsertPos = CopyMI;
}
End = std::next(MachineBasicBlock::iterator(MI));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113116.384466.patch
Type: text/x-patch
Size: 1300 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211103/4d6fb6d5/attachment.bin>
More information about the llvm-commits
mailing list