From 6c6adde84f31fb83ba35dc08a8420afb7ce7e093 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 24 Jun 2020 19:27:22 +0100 Subject: [PATCH] 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. --- llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 6 +++--- llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index 2ad9c73..d256e77 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -18,7 +18,6 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/Statistic.h" -#include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/InstructionSimplify.h" #include "llvm/Analysis/TargetFolder.h" #include "llvm/Analysis/ValueTracking.h" @@ -52,6 +51,7 @@ using namespace llvm::PatternMatch; namespace llvm { +class AAResults; class APInt; class AssumptionCache; class BlockFrequencyInfo; @@ -316,7 +316,7 @@ private: // Mode in which we are running the combiner. const bool MinimizeSize; - AliasAnalysis *AA; + AAResults *AA; // Required analyses. AssumptionCache ∾ @@ -336,7 +336,7 @@ private: public: InstCombiner(InstCombineWorklist &Worklist, BuilderTy &Builder, - bool MinimizeSize, AliasAnalysis *AA, + bool MinimizeSize, AAResults *AA, AssumptionCache &AC, TargetLibraryInfo &TLI, DominatorTree &DT, OptimizationRemarkEmitter &ORE, BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI, const DataLayout &DL, LoopInfo *LI) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index afb4b98..17f33be 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -14,8 +14,8 @@ #include "llvm/ADT/MapVector.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/Loads.h" -#include "llvm/Transforms/Utils/Local.h" #include "llvm/IR/ConstantRange.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/DebugInfoMetadata.h" @@ -24,6 +24,7 @@ #include "llvm/IR/MDBuilder.h" #include "llvm/IR/PatternMatch.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" +#include "llvm/Transforms/Utils/Local.h" using namespace llvm; using namespace PatternMatch; @@ -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 /// can optimize this. static bool -isOnlyCopiedFromConstantMemory(AliasAnalysis *AA, +isOnlyCopiedFromConstantMemory(AAResults *AA, Value *V, MemTransferInst *&TheCopy, SmallVectorImpl &ToDelete) { // We track lifetime intrinsics as we encounter them. If we decide to go @@ -144,7 +145,7 @@ isOnlyCopiedFromConstantMemory(AliasAnalysis *AA, /// 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. static MemTransferInst * -isOnlyCopiedFromConstantMemory(AliasAnalysis *AA, +isOnlyCopiedFromConstantMemory(AAResults *AA, AllocaInst *AI, SmallVectorImpl &ToDelete) { MemTransferInst *TheCopy = nullptr; -- 2.7.4