Add helper functions for computing the Location of load, store,

and vaarg instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118845 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-11-11 21:50:19 +00:00
parent ef5b390263
commit 6d8eb156e6
8 changed files with 43 additions and 66 deletions
+1 -4
View File
@@ -433,10 +433,7 @@ bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg, bool isByVal) const {
LoadInst *Load = Loads[i];
BasicBlock *BB = Load->getParent();
AliasAnalysis::Location Loc(Load->getPointerOperand(),
AA.getTypeStoreSize(Load->getType()),
Load->getMetadata(LLVMContext::MD_tbaa));
AliasAnalysis::Location Loc = AA.getLocation(Load);
if (AA.canInstructionRangeModify(BB->front(), *Load, Loc))
return false; // Pointer is invalidated!