Skip to content

Commit e4a589b

Browse files
committed
[InstCombine] Add stats for number of iterations (NFC)
1 parent 304538a commit e4a589b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ using namespace llvm::PatternMatch;
114114

115115
STATISTIC(NumWorklistIterations,
116116
"Number of instruction combining iterations performed");
117+
STATISTIC(NumOneIteration, "Number of functions with one iteration");
118+
STATISTIC(NumTwoIterations, "Number of functions with two iterations");
119+
STATISTIC(NumThreeIterations, "Number of functions with three iterations");
120+
STATISTIC(NumFourOrMoreIterations,
121+
"Number of functions with four or more iterations");
117122

118123
STATISTIC(NumCombined , "Number of insts combined");
119124
STATISTIC(NumConstProp, "Number of constant folds");
@@ -4051,6 +4056,15 @@ static bool combineInstructionsOverFunction(
40514056
MadeIRChange = true;
40524057
}
40534058

4059+
if (Iteration == 1)
4060+
++NumOneIteration;
4061+
else if (Iteration == 2)
4062+
++NumTwoIterations;
4063+
else if (Iteration == 3)
4064+
++NumThreeIterations;
4065+
else
4066+
++NumFourOrMoreIterations;
4067+
40544068
return MadeIRChange;
40554069
}
40564070

0 commit comments

Comments
 (0)