aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2021-10-08 10:49:54 -0700
committerPhilip Reames <listmail@philipreames.com>2021-10-08 10:59:35 -0700
commitedf31b4db1be3acdac1204a1c232454af20569e4 (patch)
tree20df6a07ed97b9545e2ed8836f0f05846dce3677
parentde5477ed4255ee59b45c3d71552d89dfe262748f (diff)
downloadllvm-edf31b4db1be3acdac1204a1c232454af20569e4.zip
llvm-edf31b4db1be3acdac1204a1c232454af20569e4.tar.gz
llvm-edf31b4db1be3acdac1204a1c232454af20569e4.tar.bz2
[IPT] Add a statistic to track instructions scanned to answer queries
I'm planning some changes to the invalidation mechanism here, and having a concrete mechanism to track progress is key.
-rw-r--r--llvm/lib/Analysis/InstructionPrecedenceTracking.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp b/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp
index e226555..9fee57c 100644
--- a/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp
+++ b/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp
@@ -19,11 +19,15 @@
#include "llvm/Analysis/InstructionPrecedenceTracking.h"
#include "llvm/Analysis/ValueTracking.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
+#define DEBUG_TYPE "ipt"
+STATISTIC(NumInstScanned, "Number of insts scanned while updating ibt");
+
#ifndef NDEBUG
static cl::opt<bool> ExpensiveAsserts(
"ipt-expensive-asserts",
@@ -64,11 +68,13 @@ bool InstructionPrecedenceTracking::isPreceededBySpecialInstruction(
void InstructionPrecedenceTracking::fill(const BasicBlock *BB) {
FirstSpecialInsts.erase(BB);
- for (auto &I : *BB)
+ for (auto &I : *BB) {
+ NumInstScanned++;
if (isSpecialInstruction(&I)) {
FirstSpecialInsts[BB] = &I;
return;
}
+ }
// Mark this block as having no special instructions.
FirstSpecialInsts[BB] = nullptr;