mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
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
This commit is contained in:
parent
7ad3920e31
commit
c0755a6f98
@ -1089,15 +1089,10 @@ bool GVN::performReturnSlotOptzn(MemCpyInst* cpy, CallInst* C,
|
|||||||
|
|
||||||
// If all checks passed, then we can perform the transformation
|
// If all checks passed, then we can perform the transformation
|
||||||
CallSite CS = CallSite::get(C);
|
CallSite CS = CallSite::get(C);
|
||||||
for (unsigned i = 0; i < CS.arg_size(); ++i) {
|
if (CS.getArgument(0)->getType() != cpyDest->getType())
|
||||||
if (CS.paramHasAttr(i+1, ParamAttr::StructRet)) {
|
return false;
|
||||||
if (CS.getArgument(i)->getType() != cpyDest->getType())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
CS.setArgument(i, cpyDest);
|
CS.setArgument(0, cpyDest);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
|
MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
|
||||||
MD.dropInstruction(C);
|
MD.dropInstruction(C);
|
||||||
|
Loading…
Reference in New Issue
Block a user