[NFC][SimplifyCFG] Add statistic to FoldBranchToCommonDest() fold
This commit is contained in:
parent
433d0a30c6
commit
65db7d38e0
@ -159,6 +159,8 @@ STATISTIC(
|
||||
NumLookupTablesHoles,
|
||||
"Number of switch instructions turned into lookup tables (holes checked)");
|
||||
STATISTIC(NumTableCmpReuses, "Number of reused switch table lookup compares");
|
||||
STATISTIC(NumFoldBranchToCommonDest,
|
||||
"Number of branches folded into predecessor basic block");
|
||||
STATISTIC(
|
||||
NumHoistCommonCode,
|
||||
"Number of common instruction 'blocks' hoisted up to the begin block");
|
||||
@ -2710,6 +2712,12 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, MemorySSAUpdater *MSSAU,
|
||||
const unsigned PredCount = pred_size(BB);
|
||||
|
||||
bool Changed = false;
|
||||
|
||||
auto _ = make_scope_exit([&]() {
|
||||
if (Changed)
|
||||
++NumFoldBranchToCommonDest;
|
||||
});
|
||||
|
||||
TargetTransformInfo::TargetCostKind CostKind =
|
||||
BB->getParent()->hasMinSize() ? TargetTransformInfo::TCK_CodeSize
|
||||
: TargetTransformInfo::TCK_SizeAndLatency;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user