summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-11-11 21:50:19 +0000
committerDan Gohman <gohman@apple.com>2010-11-11 21:50:19 +0000
commit6d8eb156e6be727570b300bac7712f745a318c7d (patch)
treecd4250cc4395e8077f2dac80017fbe44ae96a94b /lib/Transforms/IPO/FunctionAttrs.cpp
parentef5b390263ebe6e22c89cb16faebf0fb3c4ce1ee (diff)
downloadllvm-6d8eb156e6be727570b300bac7712f745a318c7d.tar.gz
llvm-6d8eb156e6be727570b300bac7712f745a318c7d.tar.bz2
llvm-6d8eb156e6be727570b300bac7712f745a318c7d.tar.xz
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
Diffstat (limited to 'lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--lib/Transforms/IPO/FunctionAttrs.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp
index bb3ee46571..95decec0f8 100644
--- a/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -165,27 +165,20 @@ bool FunctionAttrs::AddReadAttrs(const CallGraphSCC &SCC) {
} else if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
// Ignore non-volatile loads from local memory.
if (!LI->isVolatile()) {
- AliasAnalysis::Location Loc(LI->getPointerOperand(),
- AA->getTypeStoreSize(LI->getType()),
- LI->getMetadata(LLVMContext::MD_tbaa));
+ AliasAnalysis::Location Loc = AA->getLocation(LI);
if (AA->pointsToConstantMemory(Loc, /*OrLocal=*/true))
continue;
}
} else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
// Ignore non-volatile stores to local memory.
if (!SI->isVolatile()) {
- const Type *StoredType = SI->getValueOperand()->getType();
- AliasAnalysis::Location Loc(SI->getPointerOperand(),
- AA->getTypeStoreSize(StoredType),
- SI->getMetadata(LLVMContext::MD_tbaa));
+ AliasAnalysis::Location Loc = AA->getLocation(SI);
if (AA->pointsToConstantMemory(Loc, /*OrLocal=*/true))
continue;
}
} else if (VAArgInst *VI = dyn_cast<VAArgInst>(I)) {
// Ignore vaargs on local memory.
- AliasAnalysis::Location Loc(VI->getPointerOperand(),
- AliasAnalysis::UnknownSize,
- VI->getMetadata(LLVMContext::MD_tbaa));
+ AliasAnalysis::Location Loc = AA->getLocation(VI);
if (AA->pointsToConstantMemory(Loc, /*OrLocal=*/true))
continue;
}