Skip to content

Commit 8fafc04

Browse files
committed
drop logIf
Created using spr 1.3.4
1 parent 0f455d0 commit 8fafc04

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

bolt/lib/Profile/StaleProfileMatching.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -331,19 +331,12 @@ class StaleMatcher {
331331
if (!opts::StaleMatchingWithBlockPseudoProbes)
332332
return {nullptr, false};
333333

334-
auto logIf = [](bool Expr, StringRef Message) {
335-
LLVM_DEBUG(if (Expr) errs() << Message << '\n');
336-
return Expr;
337-
};
338-
339334
DenseMap<const FlowBlock *, uint32_t> FlowBlockMatchCount;
340335

341336
for (const yaml::bolt::PseudoProbeInfo &Probe : BlockPseudoProbes) {
342337
const MCDecodedPseudoProbeInlineTree *InlineTreeNode =
343338
getInlineTreeNode(Probe.InlineTreeIndex);
344-
if (logIf(!InlineTreeNode,
345-
formatv("no matching inline tree node for {0} {1}",
346-
Probe.InlineTreeIndex, Probe.Index).str())) {
339+
if (!InlineTreeNode) {
347340
++FlowBlockMatchCount[nullptr];
348341
continue;
349342
}
@@ -355,17 +348,12 @@ class StaleMatcher {
355348
BinaryProbe = &FuncProbe;
356349
break;
357350
}
358-
if (logIf(!BinaryProbe, formatv("no matching binary probe for {0} {1}",
359-
Probe.InlineTreeIndex, Probe.Index)
360-
.str())) {
351+
if (!BinaryProbe) {
361352
++FlowBlockMatchCount[nullptr];
362353
continue;
363354
}
364355
auto It = BBPseudoProbeToBlock.find(BinaryProbe);
365-
if (logIf(It == BBPseudoProbeToBlock.end(),
366-
formatv("no probe->block for {0} {1}", Probe.InlineTreeIndex,
367-
Probe.Index)
368-
.str())) {
356+
if (It == BBPseudoProbeToBlock.end()) {
369357
++FlowBlockMatchCount[nullptr];
370358
continue;
371359
}
@@ -376,9 +364,6 @@ class StaleMatcher {
376364
uint32_t TotalMatchCount = 0;
377365
const FlowBlock *BestMatchBlock = nullptr;
378366
for (auto &[Block, Count] : FlowBlockMatchCount) {
379-
logIf(true, formatv("block {0} count {1}",
380-
Block ? Block->Index : UINT64_MAX, Count)
381-
.str());
382367
TotalMatchCount += Count;
383368
if (Count > BestMatchCount ||
384369
(Count == BestMatchCount && !BestMatchBlock)) {

0 commit comments

Comments
 (0)