File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
llvm/lib/Transforms/Instrumentation Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1517,9 +1517,10 @@ void PGOUseFunc::populateCoverage(IndexedInstrProfReader *PGOReader) {
1517
1517
CoveredBlocksToProcess.pop ();
1518
1518
for (auto *BB : InverseDependencies[CoveredBlock]) {
1519
1519
// If CoveredBlock is covered then BB is covered.
1520
- if (Coverage[BB])
1520
+ bool &Cov = Coverage[BB];
1521
+ if (Cov)
1521
1522
continue ;
1522
- Coverage[BB] = true ;
1523
+ Cov = true ;
1523
1524
CoveredBlocksToProcess.push (BB);
1524
1525
}
1525
1526
}
@@ -1563,14 +1564,15 @@ void PGOUseFunc::populateCoverage(IndexedInstrProfReader *PGOReader) {
1563
1564
// successors, e.g., when a block calls a function that may call exit(). In
1564
1565
// those cases, BFI could find its successor to be covered while BCI could
1565
1566
// find its successor to be dead.
1566
- if (Coverage[&BB] == IsBlockDead (BB).value_or (false )) {
1567
+ const bool &Cov = Coverage[&BB];
1568
+ if (Cov == IsBlockDead (BB).value_or (false )) {
1567
1569
LLVM_DEBUG (
1568
1570
dbgs () << " Found inconsistent block covearge for " << BB.getName ()
1569
- << " : BCI=" << (Coverage[&BB] ? " Covered" : " Dead" ) << " BFI="
1571
+ << " : BCI=" << (Cov ? " Covered" : " Dead" ) << " BFI="
1570
1572
<< (IsBlockDead (BB).value () ? " Dead" : " Covered" ) << " \n " );
1571
1573
++NumCorruptCoverage;
1572
1574
}
1573
- if (Coverage[&BB] )
1575
+ if (Cov )
1574
1576
++NumCoveredBlocks;
1575
1577
}
1576
1578
if (PGOVerifyBFI && NumCorruptCoverage) {
You can’t perform that action at this time.
0 commit comments