[llvm] f6329a6 - GVN.h - reduce AliasAnalysis.h include to forward declaration. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 25 09:00:55 PDT 2020
Author: Simon Pilgrim
Date: 2020-06-25T16:59:35+01:00
New Revision: f6329a6875e21bdcfe4791ce46a50bcafca2f007
URL: https://github.com/llvm/llvm-project/commit/f6329a6875e21bdcfe4791ce46a50bcafca2f007
DIFF: https://github.com/llvm/llvm-project/commit/f6329a6875e21bdcfe4791ce46a50bcafca2f007.diff
LOG: 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.
Added:
Modified:
llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
llvm/include/llvm/Transforms/Scalar/GVN.h
llvm/lib/Analysis/MemDepPrinter.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
index f69adc2d9b77..0777dc7d7862 100644
--- a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
+++ b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
@@ -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 @@ class MemoryDependenceResults {
ReverseDepMapType ReverseNonLocalDeps;
/// Current AA implementation, just a cache.
- AliasAnalysis &AA;
+ AAResults &AA;
AssumptionCache ∾
const TargetLibraryInfo &TLI;
DominatorTree &DT;
@@ -365,7 +365,7 @@ class MemoryDependenceResults {
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),
diff --git a/llvm/include/llvm/Transforms/Scalar/GVN.h b/llvm/include/llvm/Transforms/Scalar/GVN.h
index 68989f9614bf..f2818c6b792e 100644
--- a/llvm/include/llvm/Transforms/Scalar/GVN.h
+++ b/llvm/include/llvm/Transforms/Scalar/GVN.h
@@ -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 @@ class GVN : public PassInfoMixin<GVN> {
}
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 @@ class GVN : public PassInfoMixin<GVN> {
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 @@ class GVN : public PassInfoMixin<GVN> {
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; }
diff --git a/llvm/lib/Analysis/MemDepPrinter.cpp b/llvm/lib/Analysis/MemDepPrinter.cpp
index 2c57e63251c6..9524ec96bb61 100644
--- a/llvm/lib/Analysis/MemDepPrinter.cpp
+++ b/llvm/lib/Analysis/MemDepPrinter.cpp
@@ -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 {
More information about the llvm-commits
mailing list