aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-02-19 03:15:29 +0000
committerOwen Anderson <resistor@mac.com>2008-02-19 03:15:29 +0000
commit50ae8ca666b98988b3e3f95d4aa524b82aad9a7c (patch)
tree025a5005c64fc49f75235f77d6d14bbfec0ffbd7
parent6a7dfab28e372526a88a3978c573db8a6e8a3931 (diff)
downloadexternal_llvm-50ae8ca666b98988b3e3f95d4aa524b82aad9a7c.zip
external_llvm-50ae8ca666b98988b3e3f95d4aa524b82aad9a7c.tar.gz
external_llvm-50ae8ca666b98988b3e3f95d4aa524b82aad9a7c.tar.bz2
An sret parameter is required to be the first parameter, so there's no need to loop
over all the parameters of the callee looking for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47309 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/GVN.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index f34ae69..4de0f3d 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -1089,15 +1089,10 @@ bool GVN::performReturnSlotOptzn(MemCpyInst* cpy, CallInst* C,
// If all checks passed, then we can perform the transformation
CallSite CS = CallSite::get(C);
- for (unsigned i = 0; i < CS.arg_size(); ++i) {
- if (CS.paramHasAttr(i+1, ParamAttr::StructRet)) {
- if (CS.getArgument(i)->getType() != cpyDest->getType())
- return false;
+ if (CS.getArgument(0)->getType() != cpyDest->getType())
+ return false;
- CS.setArgument(i, cpyDest);
- break;
- }
- }
+ CS.setArgument(0, cpyDest);
MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
MD.dropInstruction(C);