diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-09-01 09:01:39 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-09-01 09:01:39 +0000 |
commit | 0c083024f0fdaa958ec8b1a8cd5b27dc53bf68af (patch) | |
tree | b8e70c0bfaf8bc42943206a14bc7dd4491303f6e /llvm/lib/Transforms/IPO/Inliner.cpp | |
parent | fc243d54d2048bec081a6c0257288306960f3e49 (diff) | |
download | bcm5719-llvm-0c083024f0fdaa958ec8b1a8cd5b27dc53bf68af.tar.gz bcm5719-llvm-0c083024f0fdaa958ec8b1a8cd5b27dc53bf68af.zip |
Feed AA to the inliner and use AA->getModRefBehavior in AddAliasScopeMetadata
This feeds AA through the IFI structure into the inliner so that
AddAliasScopeMetadata can use AA->getModRefBehavior to figure out which
functions only access their arguments (instead of just hard-coding some
knowledge of memory intrinsics). Most of the information is only available from
BasicAA; this is important for preserving alias scoping information for
target-specific intrinsics when doing the noalias parameter attribute to
metadata conversion.
llvm-svn: 216866
Diffstat (limited to 'llvm/lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index a09387832df..3cb6479a10c 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -16,6 +16,7 @@ #include "llvm/Transforms/IPO/InlinerPass.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/CallGraph.h" #include "llvm/Analysis/InlineCost.h" #include "llvm/IR/CallSite.h" @@ -74,6 +75,7 @@ Inliner::Inliner(char &ID, int Threshold, bool InsertLifetime) /// the call graph. If the derived class implements this method, it should /// always explicitly call the implementation here. void Inliner::getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired<AliasAnalysis>(); CallGraphSCCPass::getAnalysisUsage(AU); } @@ -442,6 +444,7 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) { DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>(); const DataLayout *DL = DLP ? &DLP->getDataLayout() : nullptr; const TargetLibraryInfo *TLI = getAnalysisIfAvailable<TargetLibraryInfo>(); + AliasAnalysis *AA = &getAnalysis<AliasAnalysis>(); SmallPtrSet<Function*, 8> SCCFunctions; DEBUG(dbgs() << "Inliner visiting SCC:"); @@ -500,7 +503,7 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) { InlinedArrayAllocasTy InlinedArrayAllocas; - InlineFunctionInfo InlineInfo(&CG, DL); + InlineFunctionInfo InlineInfo(&CG, DL, AA); // Now that we have all of the call sites, loop over them and inline them if // it looks profitable to do so. |