summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-11-09 20:17:38 +0000
committerDan Gohman <gohman@apple.com>2010-11-09 20:17:38 +0000
commite3467a768798e17e6310ad5d5fb098b097775e66 (patch)
treea485e1ea7a900f32ea545685c91d1475b98883cc /llvm/lib/Transforms
parent8ea6442f92ad028e96c74cd147e7ca6bd639107f (diff)
downloadbcm5719-llvm-e3467a768798e17e6310ad5d5fb098b097775e66.tar.gz
bcm5719-llvm-e3467a768798e17e6310ad5d5fb098b097775e66.zip
Teach FunctionAttrs about the VAArg instruction.
llvm-svn: 118627
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionAttrs.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
index fcdc5f18f16..8bdf5d75dad 100644
--- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -195,6 +195,13 @@ bool FunctionAttrs::AddReadAttrs(const CallGraphSCC &SCC) {
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));
+ if (AA->pointsToConstantMemory(Loc, /*OrLocal=*/true))
+ continue;
}
// Any remaining instructions need to be taken seriously! Check if they
OpenPOWER on IntegriCloud