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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216866 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Hal Finkel
2014-09-01 09:01:39 +00:00
parent 0cbef49d90
commit 32418db285
6 changed files with 33 additions and 16 deletions

View File

@ -43,6 +43,7 @@ class DataLayout;
class Loop;
class LoopInfo;
class AllocaInst;
class AliasAnalysis;
/// CloneModule - Return an exact copy of the specified module
///
@ -157,13 +158,16 @@ void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
/// InlineFunction call, and records the auxiliary results produced by it.
class InlineFunctionInfo {
public:
explicit InlineFunctionInfo(CallGraph *cg = nullptr, const DataLayout *DL = nullptr)
: CG(cg), DL(DL) {}
explicit InlineFunctionInfo(CallGraph *cg = nullptr,
const DataLayout *DL = nullptr,
AliasAnalysis *AA = nullptr)
: CG(cg), DL(DL), AA(AA) {}
/// CG - If non-null, InlineFunction will update the callgraph to reflect the
/// changes it makes.
CallGraph *CG;
const DataLayout *DL;
AliasAnalysis *AA;
/// StaticAllocas - InlineFunction fills this in with all static allocas that
/// get copied into the caller.