Skip to content

Commit 7e02bc8

Browse files
committed
[NFC][ARM] LowOverheadLoop DEBUG statements
1 parent cccb7cf commit 7e02bc8

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,10 @@ bool LowOverheadLoop::ValidateTailPredicate() {
603603
return false;
604604
}
605605

606-
if (!VPTState::isValid(RDA))
606+
if (!VPTState::isValid(RDA)) {
607+
LLVM_DEBUG(dbgs() << "ARM Loops: Invalid VPT state.\n");
607608
return false;
609+
}
608610

609611
if (!ValidateLiveOuts()) {
610612
LLVM_DEBUG(dbgs() << "ARM Loops: Invalid live outs.\n");
@@ -655,9 +657,13 @@ bool LowOverheadLoop::ValidateTailPredicate() {
655657
// instructions in the preheader.
656658
auto CannotInsertWDLSTPBetween = [](MachineBasicBlock::iterator I,
657659
MachineBasicBlock::iterator E) {
658-
for (; I != E; ++I)
659-
if (shouldInspect(*I))
660+
for (; I != E; ++I) {
661+
if (shouldInspect(*I)) {
662+
LLVM_DEBUG(dbgs() << "ARM Loops: Instruction blocks [W|D]LSTP"
663+
<< " insertion: " << *I);
660664
return true;
665+
}
666+
}
661667
return false;
662668
};
663669

@@ -719,11 +725,17 @@ bool LowOverheadLoop::ValidateTailPredicate() {
719725
continue;
720726

721727
if (isSubImmOpcode(MI->getOpcode())) {
722-
if (FoundSub || !IsValidSub(MI, ExpectedVectorWidth))
728+
if (FoundSub || !IsValidSub(MI, ExpectedVectorWidth)) {
729+
LLVM_DEBUG(dbgs() << "ARM Loops: Unexpected instruction in element"
730+
" count: " << *MI);
723731
return false;
732+
}
724733
FoundSub = true;
725-
} else
734+
} else {
735+
LLVM_DEBUG(dbgs() << "ARM Loops: Unexpected instruction in element"
736+
" count: " << *MI);
726737
return false;
738+
}
727739
}
728740
ToRemove.insert(ElementChain.begin(), ElementChain.end());
729741
}
@@ -1082,8 +1094,14 @@ void LowOverheadLoop::Validate(ARMBasicBlockUtils *BBUtils) {
10821094
Revert = true;
10831095
return;
10841096
}
1085-
10861097
TryAdjustInsertionPoint(StartInsertPt, Start, RDA);
1098+
LLVM_DEBUG(if (StartInsertPt == StartInsertBB->end())
1099+
dbgs() << "ARM Loops: Will insert LoopStart at end of block\n";
1100+
else
1101+
dbgs() << "ARM Loops: Will insert LoopStart at "
1102+
<< *StartInsertPt
1103+
);
1104+
10871105
Revert = !ValidateRanges(Start, End, BBUtils, ML);
10881106
CannotTailPredicate = !ValidateTailPredicate();
10891107
}

0 commit comments

Comments
 (0)