if (Count) {
Modified.insert(&Function);
if (opts::Verbosity > 0)
- outs() << "BOLT-INFO: Removed " << Count
+ outs() << "BOLT-INFO: removed " << Count
<< " dead basic block(s) accounting for " << Bytes
<< " bytes in function " << Function << '\n';
}
runOnFunction(Function);
}
- outs() << "BOLT-INFO: UCE removed " << DeletedBlocks << " blocks and "
- << DeletedBytes << " bytes of code.\n";
+ if (DeletedBlocks)
+ outs() << "BOLT-INFO: UCE removed " << DeletedBlocks << " blocks and "
+ << DeletedBytes << " bytes of code\n";
}
bool ReorderBasicBlocks::shouldPrint(const BinaryFunction &BF) const {
}
}
- outs() << "BOLT-INFO: SCTC: patched " << NumTailCallsPatched
- << " tail calls (" << NumOrigForwardBranches << " forward)"
- << " tail calls (" << NumOrigBackwardBranches << " backward)"
- << " from a total of " << NumCandidateTailCalls << " while removing "
- << NumDoubleJumps << " double jumps"
- << " and removing " << DeletedBlocks << " basic blocks"
- << " totalling " << DeletedBytes
- << " bytes of code. CTCs total execution count is " << CTCExecCount
- << " and the number of times CTCs are taken is " << CTCTakenCount
- << ".\n";
+ if (NumTailCallsPatched)
+ outs() << "BOLT-INFO: SCTC: patched " << NumTailCallsPatched
+ << " tail calls (" << NumOrigForwardBranches << " forward)"
+ << " tail calls (" << NumOrigBackwardBranches << " backward)"
+ << " from a total of " << NumCandidateTailCalls << " while removing "
+ << NumDoubleJumps << " double jumps"
+ << " and removing " << DeletedBlocks << " basic blocks"
+ << " totalling " << DeletedBytes
+ << " bytes of code. CTCs total execution count is " << CTCExecCount
+ << " and the number of times CTCs are taken is " << CTCTakenCount
+ << "\n";
}
uint64_t ShortenInstructions::shortenInstructions(BinaryFunction &Function) {
[&](BinaryFunction &BF) { NumShortened += shortenInstructions(BF); },
nullptr, "ShortenInstructions");
- outs() << "BOLT-INFO: " << NumShortened << " instructions were shortened\n";
+ if (NumShortened)
+ outs() << "BOLT-INFO: " << NumShortened << " instructions were shortened\n";
}
void Peepholes::addTailcallTraps(BinaryFunction &Function) {
# RUN: llvm-bolt %t.exe --relocs=0 --jump-tables=move --print-finalized \
# RUN: -o %t.out | FileCheck %s
-# CHECK: BOLT-INFO: UCE removed 0 blocks and 0 bytes of code.
+# CHECK-NOT: BOLT-INFO: UCE removed {{.*}} blocks and {{.*}} bytes of code
# CHECK: Binary Function "main"
# CHECK: .LFT{{.*}} (2 instructions, align : 1)
# CHECK-NEXT: CFI State : 0
# RUN: llvm-bolt %t.exe --relocs=0 --jump-tables=move --print-finalized \
# RUN: -o %t.out | FileCheck %s
-CHECK: BOLT-INFO: UCE removed 0 blocks and 0 bytes of code.
+CHECK-NOT: BOLT-INFO: UCE removed {{.*}} blocks and {{.*}}| bytes of code
CHECK: Binary Function "main"
CHECK: .LFT0 (2 instructions, align : 1)
CHECK-NEXT: CFI State : 0
RUN: --no-show-raw-insn | FileCheck %s
BOLT: BB Layout : .LBB{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .LLP{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}
-BOLT: BOLT-INFO: UCE removed 4 blocks and 16 bytes of code.
+BOLT: BOLT-INFO: UCE removed 4 blocks and 16 bytes of code
BOLT: BB Layout : .LBB{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .LLP{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}
CHECK: <foo>: