Skip to content

Commit f3d8a5c

Browse files
authored
[IPT] Remove ipt.NumInstScanned statistic (#168515)
The NumInstScanned statistic is non-determinstic across multiple identical invocations of LLVM, and leads to noise when trying to diff LLVM statistics with e.g. ./utils/tdiff.py in llvm-test-suite. My understanding is that it's non-deterministic because the users of IPT's hasSpecialInstructions/isPreceededBySpecialInstruction API aren't deterministic themselves. This PR removes it and fixes #157598. This is just a small quality-of-life improvement for the ./utils/tdiff.py workflow, but happy to leave the statistic in if others are using it.
1 parent 80d327e commit f3d8a5c

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

llvm/lib/Analysis/InstructionPrecedenceTracking.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,11 @@
1919

2020
#include "llvm/Analysis/InstructionPrecedenceTracking.h"
2121
#include "llvm/Analysis/ValueTracking.h"
22-
#include "llvm/ADT/Statistic.h"
2322
#include "llvm/IR/PatternMatch.h"
2423
#include "llvm/Support/CommandLine.h"
2524

2625
using namespace llvm;
2726

28-
#define DEBUG_TYPE "ipt"
29-
STATISTIC(NumInstScanned, "Number of insts scanned while updating ibt");
30-
3127
#ifndef NDEBUG
3228
static cl::opt<bool> ExpensiveAsserts(
3329
"ipt-expensive-asserts",
@@ -50,7 +46,6 @@ const Instruction *InstructionPrecedenceTracking::getFirstSpecialInstruction(
5046
auto [It, Inserted] = FirstSpecialInsts.try_emplace(BB);
5147
if (Inserted) {
5248
for (const auto &I : *BB) {
53-
NumInstScanned++;
5449
if (isSpecialInstruction(&I)) {
5550
It->second = &I;
5651
break;

0 commit comments

Comments
 (0)