aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--lib/Transforms/IPO/FunctionAttrs.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp
index fcdc5f18f1..8bdf5d75da 100644
--- a/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/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