From 0bc051607859c10e151c9dd9fd06246f7dc098ac Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Thu, 25 Apr 2002 04:43:45 +0000 Subject: [PATCH] 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 --- lib/Target/SparcV9/SparcV9TargetMachine.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp index 0fe8f1efcec..de778e25628 100644 --- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp +++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp @@ -57,10 +57,10 @@ int UltraSparcFrameInfo::getRegSpillAreaOffset(MachineCodeForMethod& mcInfo, bool& pos) const { + mcInfo.freezeAutomaticVarsArea(); // ensure no more auto vars are added + pos = false; // static stack area grows downwards unsigned int autoVarsSize = mcInfo.getAutomaticVarsSize(); - if (int mod = autoVarsSize % getStackFrameSizeAlignment()) - autoVarsSize += (getStackFrameSizeAlignment() - mod); return StaticAreaOffsetFromFP - autoVarsSize; } @@ -68,12 +68,13 @@ int UltraSparcFrameInfo::getTmpAreaOffset(MachineCodeForMethod& mcInfo, 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 unsigned int autoVarsSize = mcInfo.getAutomaticVarsSize(); unsigned int spillAreaSize = mcInfo.getRegSpillsSize(); int offset = autoVarsSize + spillAreaSize; - if (int mod = offset % getStackFrameSizeAlignment()) - offset += (getStackFrameSizeAlignment() - mod); return StaticAreaOffsetFromFP - offset; }