diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-01-03 17:05:32 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-01-03 17:05:32 +0000 |
commit | 1d805c62c4e7aac89965b7d7cd40d28fc8e1bac5 (patch) | |
tree | e5306f6ea4c6ed85e0761238f16874b2c0483673 /llvm/lib | |
parent | 2216c9804db9cfc8986957118a88afd3f5c81d57 (diff) | |
download | bcm5719-llvm-1d805c62c4e7aac89965b7d7cd40d28fc8e1bac5.tar.gz bcm5719-llvm-1d805c62c4e7aac89965b7d7cd40d28fc8e1bac5.zip |
Any void readonly functions are provably dead, don't waste time adding
nocapture attributes to them.
llvm-svn: 61610
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp index aea4cb4cf26..453b3c51aa2 100644 --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -307,20 +307,6 @@ bool FunctionAttrs::AddNoCaptureAttrs(const std::vector<CallGraphNode *> &SCC) { // External node - skip it; continue; - // If the function is readonly and doesn't return any value, we know that - // the pointer value is not captured. Mark all of its pointer arguments - // nocapture. - if (F->onlyReadsMemory() && F->getReturnType() == Type::VoidTy) { - for (Function::arg_iterator A = F->arg_begin(), E = F->arg_end(); - A != E; ++A) - if (isa<PointerType>(A->getType()) && !A->hasNoCaptureAttr()) { - A->addAttr(Attribute::NoCapture); - ++NumNoCapture; - Changed = true; - } - continue; - } - // Definitions with weak linkage may be overridden at linktime with // something that writes memory, so treat them like declarations. if (F->isDeclaration() || F->mayBeOverridden()) |