mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
Forward substitute some constants into their users
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15693 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3927af8d70
commit
4f65fb38c6
@ -319,8 +319,6 @@ static unsigned
|
|||||||
ComputeMaxOptionalArgsSize(const TargetMachine& target, const Function *F,
|
ComputeMaxOptionalArgsSize(const TargetMachine& target, const Function *F,
|
||||||
unsigned &maxOptionalNumArgs)
|
unsigned &maxOptionalNumArgs)
|
||||||
{
|
{
|
||||||
const TargetFrameInfo &frameInfo = *target.getFrameInfo();
|
|
||||||
|
|
||||||
unsigned maxSize = 0;
|
unsigned maxSize = 0;
|
||||||
|
|
||||||
for (Function::const_iterator BB = F->begin(), BBE = F->end(); BB !=BBE; ++BB)
|
for (Function::const_iterator BB = F->begin(), BBE = F->end(); BB !=BBE; ++BB)
|
||||||
@ -328,7 +326,7 @@ ComputeMaxOptionalArgsSize(const TargetMachine& target, const Function *F,
|
|||||||
if (const CallInst *callInst = dyn_cast<CallInst>(I))
|
if (const CallInst *callInst = dyn_cast<CallInst>(I))
|
||||||
{
|
{
|
||||||
unsigned numOperands = callInst->getNumOperands() - 1;
|
unsigned numOperands = callInst->getNumOperands() - 1;
|
||||||
int numExtra = (int)numOperands-frameInfo.getNumFixedOutgoingArgs();
|
int numExtra = numOperands-6;
|
||||||
if (numExtra <= 0)
|
if (numExtra <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -370,8 +368,7 @@ void MachineFunctionInfo::CalculateArgSize() {
|
|||||||
maxOptionalArgsSize = ComputeMaxOptionalArgsSize(MF.getTarget(),
|
maxOptionalArgsSize = ComputeMaxOptionalArgsSize(MF.getTarget(),
|
||||||
MF.getFunction(),
|
MF.getFunction(),
|
||||||
maxOptionalNumArgs);
|
maxOptionalNumArgs);
|
||||||
staticStackSize = maxOptionalArgsSize
|
staticStackSize = maxOptionalArgsSize + 176;
|
||||||
+ MF.getTarget().getFrameInfo()->getMinStackFrameSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user