diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index f730d534a55..552583042a7 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -245,8 +245,7 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) { // or readnone, because the copy would be unneeded: the callee doesn't // modify the struct. if (CalledFunc->paramHasAttr(ArgNo+1, ParamAttr::ByVal) && - !CalledFunc->paramHasAttr(0, ParamAttr::ReadOnly) && - !CalledFunc->paramHasAttr(0, ParamAttr::ReadNone)) { + !CalledFunc->onlyReadsMemory()) { const Type *AggTy = cast(I->getType())->getElementType(); const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);