From: Nikita Popov Date: Tue, 6 Jun 2023 12:55:56 +0000 (+0200) Subject: [InstCombine] Add stats for number of iterations (NFC) X-Git-Tag: upstream/17.0.6~6007 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4a589ba5dbd426d30d945ebf8210c8d5114f5b9;p=platform%2Fupstream%2Fllvm.git [InstCombine] Add stats for number of iterations (NFC) --- diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 80abfc9..311dd5a 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -114,6 +114,11 @@ using namespace llvm::PatternMatch; STATISTIC(NumWorklistIterations, "Number of instruction combining iterations performed"); +STATISTIC(NumOneIteration, "Number of functions with one iteration"); +STATISTIC(NumTwoIterations, "Number of functions with two iterations"); +STATISTIC(NumThreeIterations, "Number of functions with three iterations"); +STATISTIC(NumFourOrMoreIterations, + "Number of functions with four or more iterations"); STATISTIC(NumCombined , "Number of insts combined"); STATISTIC(NumConstProp, "Number of constant folds"); @@ -4051,6 +4056,15 @@ static bool combineInstructionsOverFunction( MadeIRChange = true; } + if (Iteration == 1) + ++NumOneIteration; + else if (Iteration == 2) + ++NumTwoIterations; + else if (Iteration == 3) + ++NumThreeIterations; + else + ++NumFourOrMoreIterations; + return MadeIRChange; }