Skip to content

Commit a42f589

Browse files
committed
[LICM][NFC] Unify arithmetic statistics collection
Avoid divergence b/w different kinds of hoisting with reassociation. Make them all collect general stat NumHoisted and also specific stats for each particular transform.
1 parent 4ac6f99 commit a42f589

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Transforms/Scalar/LICM.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ STATISTIC(NumLoadPromoted, "Number of load-only promotions");
105105
STATISTIC(NumLoadStorePromoted, "Number of load and store promotions");
106106
STATISTIC(NumMinMaxHoisted,
107107
"Number of min/max expressions hoisted out of the loop");
108+
STATISTIC(NumGEPsHoisted,
109+
"Number of geps reassociated and hoisted out of the loop");
108110

109111
/// Memory promotion is enabled by default.
110112
static cl::opt<bool>
@@ -2553,13 +2555,15 @@ static bool hoistArithmetics(Instruction &I, Loop &L,
25532555
// into (x < min(INV1, INV2)), and hoisting the invariant part of this
25542556
// expression out of the loop.
25552557
if (hoistMinMax(I, L, SafetyInfo, MSSAU)) {
2558+
++NumHoisted;
25562559
++NumMinMaxHoisted;
25572560
return true;
25582561
}
25592562

25602563
// Try to hoist GEPs by reassociation.
25612564
if (hoistGEP(I, L, SafetyInfo, MSSAU, AC, DT)) {
25622565
++NumHoisted;
2566+
++NumGEPsHoisted;
25632567
return true;
25642568
}
25652569

0 commit comments

Comments
 (0)