Don't pad spills and temp. stack areas for alignment.

Freeze auto vars and spill areas when their sizes are used
for computing other offsets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2317 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vikram S. Adve
2002-04-25 04:43:45 +00:00
parent 31f78c4f6b
commit 0bc0516078

View File

@@ -57,10 +57,10 @@ int
UltraSparcFrameInfo::getRegSpillAreaOffset(MachineCodeForMethod& mcInfo, UltraSparcFrameInfo::getRegSpillAreaOffset(MachineCodeForMethod& mcInfo,
bool& pos) const bool& pos) const
{ {
mcInfo.freezeAutomaticVarsArea(); // ensure no more auto vars are added
pos = false; // static stack area grows downwards pos = false; // static stack area grows downwards
unsigned int autoVarsSize = mcInfo.getAutomaticVarsSize(); unsigned int autoVarsSize = mcInfo.getAutomaticVarsSize();
if (int mod = autoVarsSize % getStackFrameSizeAlignment())
autoVarsSize += (getStackFrameSizeAlignment() - mod);
return StaticAreaOffsetFromFP - autoVarsSize; return StaticAreaOffsetFromFP - autoVarsSize;
} }
@@ -68,12 +68,13 @@ int
UltraSparcFrameInfo::getTmpAreaOffset(MachineCodeForMethod& mcInfo, UltraSparcFrameInfo::getTmpAreaOffset(MachineCodeForMethod& mcInfo,
bool& pos) const bool& pos) const
{ {
mcInfo.freezeAutomaticVarsArea(); // ensure no more auto vars are added
mcInfo.freezeSpillsArea(); // ensure no more spill slots are added
pos = false; // static stack area grows downwards pos = false; // static stack area grows downwards
unsigned int autoVarsSize = mcInfo.getAutomaticVarsSize(); unsigned int autoVarsSize = mcInfo.getAutomaticVarsSize();
unsigned int spillAreaSize = mcInfo.getRegSpillsSize(); unsigned int spillAreaSize = mcInfo.getRegSpillsSize();
int offset = autoVarsSize + spillAreaSize; int offset = autoVarsSize + spillAreaSize;
if (int mod = offset % getStackFrameSizeAlignment())
offset += (getStackFrameSizeAlignment() - mod);
return StaticAreaOffsetFromFP - offset; return StaticAreaOffsetFromFP - offset;
} }