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

Cleanup MemoryDependenceAnalysis.h as well - GVN.h was also implicitly including AliasAnalysis.h via this.

Fix implicit include dependencies in source files and replace legacy AliasAnalysis typedef with AAResults where necessary.
This commit is contained in:
Simon Pilgrim 2020-06-25 16:37:06 +01:00
parent c0c8bb0361
commit aafcce1591
3 changed files with 10 additions and 8 deletions

View File

@ -19,7 +19,6 @@
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/PointerSumType.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Metadata.h"
@ -35,6 +34,7 @@
namespace llvm {
class AAResults;
class AssumptionCache;
class DominatorTree;
class Function;
@ -355,7 +355,7 @@ private:
ReverseDepMapType ReverseNonLocalDeps;
/// Current AA implementation, just a cache.
AliasAnalysis &AA;
AAResults &AA;
AssumptionCache ∾
const TargetLibraryInfo &TLI;
DominatorTree &DT;
@ -365,7 +365,7 @@ private:
unsigned DefaultBlockScanLimit;
public:
MemoryDependenceResults(AliasAnalysis &AA, AssumptionCache &AC,
MemoryDependenceResults(AAResults &AA, AssumptionCache &AC,
const TargetLibraryInfo &TLI, DominatorTree &DT,
PhiValues &PV, unsigned DefaultBlockScanLimit)
: AA(AA), AC(AC), TLI(TLI), DT(DT), PV(PV),

View File

@ -20,7 +20,6 @@
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/InstructionPrecedenceTracking.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/IR/Dominators.h"
@ -35,6 +34,7 @@
namespace llvm {
class AAResults;
class AssumptionCache;
class BasicBlock;
class BranchInst;
@ -123,7 +123,7 @@ public:
}
DominatorTree &getDominatorTree() const { return *DT; }
AliasAnalysis *getAliasAnalysis() const { return VN.getAliasAnalysis(); }
AAResults *getAliasAnalysis() const { return VN.getAliasAnalysis(); }
MemoryDependenceResults &getMemDep() const { return *MD; }
bool isPREEnabled() const;
@ -155,7 +155,7 @@ public:
DenseMap<std::pair<uint32_t, const BasicBlock *>, uint32_t>;
PhiTranslateMap PhiTranslateTable;
AliasAnalysis *AA = nullptr;
AAResults *AA = nullptr;
MemoryDependenceResults *MD = nullptr;
DominatorTree *DT = nullptr;
@ -191,8 +191,8 @@ public:
void add(Value *V, uint32_t num);
void clear();
void erase(Value *v);
void setAliasAnalysis(AliasAnalysis *A) { AA = A; }
AliasAnalysis *getAliasAnalysis() const { return AA; }
void setAliasAnalysis(AAResults *A) { AA = A; }
AAResults *getAliasAnalysis() const { return AA; }
void setMemDep(MemoryDependenceResults *M) { MD = M; }
void setDomTree(DominatorTree *D) { DT = D; }
uint32_t getNextUnusedValueNumber() { return nextValueNumber; }

View File

@ -10,6 +10,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/IR/InstIterator.h"
@ -17,6 +18,7 @@
#include "llvm/InitializePasses.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
namespace {