Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1517,9 +1517,10 @@ void PGOUseFunc::populateCoverage(IndexedInstrProfReader *PGOReader) {
CoveredBlocksToProcess.pop();
for (auto *BB : InverseDependencies[CoveredBlock]) {
// If CoveredBlock is covered then BB is covered.
if (Coverage[BB])
bool &Cov = Coverage[BB];
if (Cov)
continue;
Coverage[BB] = true;
Cov = true;
CoveredBlocksToProcess.push(BB);
}
}
Expand Down Expand Up @@ -1563,14 +1564,15 @@ void PGOUseFunc::populateCoverage(IndexedInstrProfReader *PGOReader) {
// successors, e.g., when a block calls a function that may call exit(). In
// those cases, BFI could find its successor to be covered while BCI could
// find its successor to be dead.
if (Coverage[&BB] == IsBlockDead(BB).value_or(false)) {
const bool &Cov = Coverage[&BB];
if (Cov == IsBlockDead(BB).value_or(false)) {
LLVM_DEBUG(
dbgs() << "Found inconsistent block covearge for " << BB.getName()
<< ": BCI=" << (Coverage[&BB] ? "Covered" : "Dead") << " BFI="
<< ": BCI=" << (Cov ? "Covered" : "Dead") << " BFI="
<< (IsBlockDead(BB).value() ? "Dead" : "Covered") << "\n");
++NumCorruptCoverage;
}
if (Coverage[&BB])
if (Cov)
++NumCoveredBlocks;
}
if (PGOVerifyBFI && NumCorruptCoverage) {
Expand Down