Skip to content

Commit 8a4d56a

Browse files
committed
[NFC] Add some debug msgs in LoopUnroll
1 parent eccae0c commit 8a4d56a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/SILOptimizer/LoopTransforms/LoopUnroll.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,12 @@ class LoopUnrolling : public SILFunctionTransform {
488488
auto *Fun = getFunction();
489489
SILLoopInfo *LoopInfo = PM->getAnalysis<SILLoopAnalysis>()->get(Fun);
490490

491+
LLVM_DEBUG(llvm::dbgs() << "Loop Unroll running on function : "
492+
<< Fun->getName() << "\n");
493+
491494
// Collect innermost loops.
492495
SmallVector<SILLoop *, 16> InnermostLoops;
496+
493497
for (auto *Loop : *LoopInfo) {
494498
SmallVector<SILLoop *, 8> Worklist;
495499
Worklist.push_back(Loop);
@@ -503,11 +507,10 @@ class LoopUnrolling : public SILFunctionTransform {
503507
}
504508
}
505509

506-
if (InnermostLoops.empty())
510+
if (InnermostLoops.empty()) {
511+
LLVM_DEBUG(llvm::dbgs() << "No innermost loops\n");
507512
return;
508-
509-
LLVM_DEBUG(llvm::dbgs() << "Loop Unroll running on function : "
510-
<< Fun->getName() << "\n");
513+
}
511514

512515
// Try to unroll innermost loops.
513516
for (auto *Loop : InnermostLoops)

0 commit comments

Comments
 (0)