diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index aea4cb4cf26..453b3c51aa2 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -307,20 +307,6 @@ bool FunctionAttrs::AddNoCaptureAttrs(const std::vector &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(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())