forked from OSchip/llvm-project
[NFC][InstCombine] Add STATISTIC() for how many iterations we did
As we've established, if it takes more than two iterations (one to perform folding and one to ensure that no folding opportunities remain) per function, then there are worklist management issues. So it may be interesting to keep track of it.
This commit is contained in:
parent
9c1ca8a3f7
commit
49d223274f
|
@ -114,6 +114,9 @@ using namespace llvm::PatternMatch;
|
|||
|
||||
#define DEBUG_TYPE "instcombine"
|
||||
|
||||
STATISTIC(NumWorklistIterations,
|
||||
"Number of instruction combining iterations performed");
|
||||
|
||||
STATISTIC(NumCombined , "Number of insts combined");
|
||||
STATISTIC(NumConstProp, "Number of constant folds");
|
||||
STATISTIC(NumDeadInst , "Number of dead inst eliminated");
|
||||
|
@ -3840,6 +3843,7 @@ static bool combineInstructionsOverFunction(
|
|||
// Iterate while there is work to do.
|
||||
unsigned Iteration = 0;
|
||||
while (true) {
|
||||
++NumWorklistIterations;
|
||||
++Iteration;
|
||||
|
||||
if (Iteration > InfiniteLoopDetectionThreshold) {
|
||||
|
|
Loading…
Reference in New Issue