diff options
| author | Owen Anderson <resistor@mac.com> | 2008-02-19 03:15:29 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2008-02-19 03:15:29 +0000 |
| commit | 551b8eeb5cc9252116933a3670e92ee9a568ec3d (patch) | |
| tree | b50b6d41d7a4316ed7b83cbfd19b156a4d137826 | |
| parent | 0e2e21b8b9a0182eb7d60d1b30cfd55d53ea72e6 (diff) | |
| download | bcm5719-llvm-551b8eeb5cc9252116933a3670e92ee9a568ec3d.tar.gz bcm5719-llvm-551b8eeb5cc9252116933a3670e92ee9a568ec3d.zip | |
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.
llvm-svn: 47309
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index f34ae69779e..4de0f3dc725 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/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); |

