Commit 6c6adde8 authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

InstCombineInternal.h - reduce AliasAnalysis.h include to forward declaration. NFC.

Fix implicit include dependencies in source files and replace legacy AliasAnalysis typedef with AAResults where necessary.
parent a53dddb3
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/InstructionSimplify.h" #include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/TargetFolder.h" #include "llvm/Analysis/TargetFolder.h"
#include "llvm/Analysis/ValueTracking.h" #include "llvm/Analysis/ValueTracking.h"
...@@ -52,6 +51,7 @@ using namespace llvm::PatternMatch; ...@@ -52,6 +51,7 @@ using namespace llvm::PatternMatch;
namespace llvm { namespace llvm {
class AAResults;
class APInt; class APInt;
class AssumptionCache; class AssumptionCache;
class BlockFrequencyInfo; class BlockFrequencyInfo;
...@@ -316,7 +316,7 @@ private: ...@@ -316,7 +316,7 @@ private:
// Mode in which we are running the combiner. // Mode in which we are running the combiner.
const bool MinimizeSize; const bool MinimizeSize;
AliasAnalysis *AA; AAResults *AA;
// Required analyses. // Required analyses.
AssumptionCache ∾ AssumptionCache ∾
...@@ -336,7 +336,7 @@ private: ...@@ -336,7 +336,7 @@ private:
public: public:
InstCombiner(InstCombineWorklist &Worklist, BuilderTy &Builder, InstCombiner(InstCombineWorklist &Worklist, BuilderTy &Builder,
bool MinimizeSize, AliasAnalysis *AA, bool MinimizeSize, AAResults *AA,
AssumptionCache &AC, TargetLibraryInfo &TLI, DominatorTree &DT, AssumptionCache &AC, TargetLibraryInfo &TLI, DominatorTree &DT,
OptimizationRemarkEmitter &ORE, BlockFrequencyInfo *BFI, OptimizationRemarkEmitter &ORE, BlockFrequencyInfo *BFI,
ProfileSummaryInfo *PSI, const DataLayout &DL, LoopInfo *LI) ProfileSummaryInfo *PSI, const DataLayout &DL, LoopInfo *LI)
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "llvm/ADT/MapVector.h" #include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/Loads.h" #include "llvm/Analysis/Loads.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/IR/ConstantRange.h" #include "llvm/IR/ConstantRange.h"
#include "llvm/IR/DataLayout.h" #include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/DebugInfoMetadata.h"
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "llvm/IR/MDBuilder.h" #include "llvm/IR/MDBuilder.h"
#include "llvm/IR/PatternMatch.h" #include "llvm/IR/PatternMatch.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
using namespace llvm; using namespace llvm;
using namespace PatternMatch; using namespace PatternMatch;
...@@ -40,7 +41,7 @@ STATISTIC(NumGlobalCopies, "Number of allocas copied from constant global"); ...@@ -40,7 +41,7 @@ STATISTIC(NumGlobalCopies, "Number of allocas copied from constant global");
/// the alloca, and if the source pointer is a pointer to a constant global, we /// the alloca, and if the source pointer is a pointer to a constant global, we
/// can optimize this. /// can optimize this.
static bool static bool
isOnlyCopiedFromConstantMemory(AliasAnalysis *AA, isOnlyCopiedFromConstantMemory(AAResults *AA,
Value *V, MemTransferInst *&TheCopy, Value *V, MemTransferInst *&TheCopy,
SmallVectorImpl<Instruction *> &ToDelete) { SmallVectorImpl<Instruction *> &ToDelete) {
// We track lifetime intrinsics as we encounter them. If we decide to go // We track lifetime intrinsics as we encounter them. If we decide to go
...@@ -144,7 +145,7 @@ isOnlyCopiedFromConstantMemory(AliasAnalysis *AA, ...@@ -144,7 +145,7 @@ isOnlyCopiedFromConstantMemory(AliasAnalysis *AA,
/// modified by a copy from a constant global. If we can prove this, we can /// modified by a copy from a constant global. If we can prove this, we can
/// replace any uses of the alloca with uses of the global directly. /// replace any uses of the alloca with uses of the global directly.
static MemTransferInst * static MemTransferInst *
isOnlyCopiedFromConstantMemory(AliasAnalysis *AA, isOnlyCopiedFromConstantMemory(AAResults *AA,
AllocaInst *AI, AllocaInst *AI,
SmallVectorImpl<Instruction *> &ToDelete) { SmallVectorImpl<Instruction *> &ToDelete) {
MemTransferInst *TheCopy = nullptr; MemTransferInst *TheCopy = nullptr;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment