Skip to content

Commit 32d1e40

Browse files
committed
refactor(compiler): add LLVM_DEBUG for enterIntvAfter fallbacks
1 parent 3759b3c commit 32d1e40

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/compiler/cgir/pass/cg_split_kit.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,18 +694,26 @@ CgSlotIndex CgSplitEditor::enterIntvAfter(CgSlotIndex Idx) {
694694
LLVM_DEBUG(dbgs() << ": valno " << ParentVNI->id << '\n');
695695
CgInstruction *MI = LIS.getInstructionFromIndex(Idx);
696696
if (!MI) {
697+
LLVM_DEBUG(dbgs() << " no MI at " << Idx << ", resolving via MBB\n");
697698
CgBasicBlock *MBB = LIS.getMBBFromIndex(Idx);
698-
if (!MBB)
699+
if (!MBB) {
700+
LLVM_DEBUG(dbgs() << " no MBB for index, keeping " << Idx << '\n');
699701
return Idx;
702+
}
700703

701704
CgSlotIndex End = LIS.getMBBEndIdx(MBB);
702-
if (Idx >= End.getPrevSlot())
705+
if (Idx >= End.getPrevSlot()) {
706+
LLVM_DEBUG(dbgs() << " at end of " << printCgBBReference(*MBB)
707+
<< ", using end\n");
703708
return enterIntvAtEnd(*MBB);
709+
}
704710

705711
CgSlotIndex NextIdx = LIS.getSlotIndexes()->getNextNonNullIndex(Idx);
706712
CgInstruction *NextMI = LIS.getInstructionFromIndex(NextIdx);
707-
if (!NextMI || NextMI->getParent() != MBB)
713+
if (!NextMI || NextMI->getParent() != MBB) {
714+
LLVM_DEBUG(dbgs() << " next MI not in block, using end\n");
708715
return enterIntvAtEnd(*MBB);
716+
}
709717

710718
CgVNInfo *VNI =
711719
defFromParent(OpenIdx, ParentVNI, Idx, *MBB, NextMI->getIterator());

0 commit comments

Comments
 (0)