diff options
author | Duncan Sands <baldrick@free.fr> | 2008-12-31 18:08:59 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-12-31 18:08:59 +0000 |
commit | 17da06ffbd1f7269b6b9037f883a3d8a5c985f62 (patch) | |
tree | 0e33d3417585a9e2401d155da5f75a4aba0693b4 /lib/Transforms/IPO/FunctionAttrs.cpp | |
parent | 3fa0de27278b73ce32a885a1b4bd29a4188266c6 (diff) |
Don't analyze arguments already marked 'nocapture'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61532 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r-- | lib/Transforms/IPO/FunctionAttrs.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index 9ed605cf9f..1824a710c5 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -263,7 +263,8 @@ bool FunctionAttrs::AddNoCaptureAttrs(const std::vector<CallGraphNode *> &SCC) { continue; for (Function::arg_iterator A = F->arg_begin(), E = F->arg_end(); A!=E; ++A) - if (isa<PointerType>(A->getType()) && !isCaptured(*F, A)) { + if (isa<PointerType>(A->getType()) && !A->hasNoCaptureAttr() && + !isCaptured(*F, A)) { A->addAttr(Attribute::NoCapture); NumNoCapture++; Changed = true; |