[llvm-commits] [llvm] r52921 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp

Dale Johannesen dalej at apple.com
Mon Jun 30 15:30:09 PDT 2008


On Jun 30, 2008, at 3:08 PMPDT, Evan Cheng wrote:

> Hi Dale,
>
> This check doesn't jive with the comment:
>
> FFI->getObjectIndexEnd() != 0))) {
>
> When getObjectIndexEnd() is equal to zero, it means there are non  
> "non-
> fixed" objects. It can still have fixed objects. Can you clarify what
> it is you are checking?

I may not have used the right terminology.
The case that causes a problem on Darwin is the second one in
X86RegisterInfo::getFrameIndexOffset, where needsStackRealignment() is
true and FI>=-0.  So abstractly what I want to check is that you can't  
get into
that case.  However, padding the stack is conservatively correct, so  
if it
aligns some low-probability case it doesn't have to, that's ok.  (The  
Linux
test cases were looking for subtracts off the SP, but were actually  
interested
in accesses to the stack, not allocation of it.  It would have been OK  
to fix this
by adjusting the testcases, but this is better.)

On Darwin the only way needsStackRealignment gets turned on is if you
allocate a stack object with alignment > 16 bytes, so this whole patch  
probably
doesn't affect anything but test cases.

> Thanks,
>
> Evan
>
> On Jun 30, 2008, at 1:40 PM, Dale Johannesen wrote:
>
>> Author: johannes
>> Date: Mon Jun 30 15:40:16 2008
>> New Revision: 52921
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=52921&view=rev
>> Log:
>> No need to align the stack if there are no stack
>> objects.  Fixes a couple of tests on Linux.
>>
>>
>> Modified:
>>   llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
>>
>> Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=52921&r1=52920&r2=52921&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> = 
>> =====================================================================
>> --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Mon Jun 30
>> 15:40:16 2008
>> @@ -464,7 +464,8 @@
>>  // works.
>>  if (!RegInfo->targetHandlesStackFrameRounding() &&
>>      (FFI->hasCalls() || FFI->hasVarSizedObjects() ||
>> -       RegInfo->needsStackRealignment(Fn))) {
>> +       (RegInfo->needsStackRealignment(Fn) &&
>> +        FFI->getObjectIndexEnd() != 0))) {
>>    // If we have reserved argument space for call sites in the
>> function
>>    // immediately on entry to the current function, count it as
>> part of the
>>    // overall stack size.
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list