[PM] Move the LoopInfo analysis pointer into the InstCombiner class
along with the other analyses.
The most obvious reason why is because eventually I need to separate out
the pass layer from the rest of the instcombiner. However, it is also
probably a compile time win as every query through the pass manager
layer is pretty slow these days.
llvm-svn: 226550
diff --git a/llvm/lib/Transforms/InstCombine/InstCombine.h b/llvm/lib/Transforms/InstCombine/InstCombine.h
index 3c3c135..e28a29f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombine.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombine.h
@@ -12,6 +12,7 @@
#include "InstCombineWorklist.h"
#include "llvm/Analysis/AssumptionCache.h"
+#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/TargetFolder.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Dominators.h"
@@ -100,6 +101,7 @@
const DataLayout *DL;
TargetLibraryInfo *TLI;
DominatorTree *DT;
+ LoopInfo *LI;
bool MadeIRChange;
LibCallSimplifier *Simplifier;
bool MinimizeSize;
@@ -115,7 +117,8 @@
static char ID; // Pass identification, replacement for typeid
InstCombiner()
- : FunctionPass(ID), DL(nullptr), DT(nullptr), Builder(nullptr) {
+ : FunctionPass(ID), DL(nullptr), DT(nullptr), LI(nullptr),
+ Builder(nullptr) {
MinimizeSize = false;
initializeInstCombinerPass(*PassRegistry::getPassRegistry());
}
@@ -133,6 +136,8 @@
DominatorTree *getDominatorTree() const { return DT; }
+ LoopInfo *getLoopInfo() const { return LI; }
+
TargetLibraryInfo *getTargetLibraryInfo() const { return TLI; }
// Visitation implementation - Implement instruction combining for different