[llvm-commits] [llvm] r79039 - in /llvm/trunk: lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMBaseRegisterInfo.h test/CodeGen/Thumb2/frameless.ll

Evan Cheng evan.cheng at apple.com
Fri Aug 14 19:05:47 PDT 2009


Fixed.

Evan

On Aug 14, 2009, at 6:59 PM, Jim Grosbach wrote:

> Yah, I have the patch reverted locally for now.
>
>
> On Aug 14, 2009, at 6:30 PM, Evan Cheng wrote:
>
>> Yeah sorry, I am fixing it now. Can you manually patch your tree  
>> first?
>>
>> Evan
>>
>> On Aug 14, 2009, at 6:22 PM, Jim Grosbach wrote:
>>
>>> Hi Evan,
>>>
>>> I'm seeing regressions with this patch applied. For example, the  
>>> eh10.C test in the gcc testsuite (llvm-gcc/gcc/testsuite/g++.old- 
>>> deja/g++.mike/eh10.C) passes before this patch and fails after.  
>>> The stack pointer is being restored improperly, leading to a  
>>> crash. Not sure why.
>>>
>>> -Jim
>>>
>>> On Aug 14, 2009, at 1:48 PM, Evan Cheng wrote:
>>>
>>>> Author: evancheng
>>>> Date: Fri Aug 14 15:48:13 2009
>>>> New Revision: 79039
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=79039&view=rev
>>>> Log:
>>>> Leaf functions which do not save CSRs can be frameless even with - 
>>>> disable-fp-elim.
>>>>
>>>> Added:
>>>> llvm/trunk/test/CodeGen/Thumb2/frameless.ll
>>>> Modified:
>>>> llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
>>>> llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h
>>>>
>>>> Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=79039&r1=79038&r2=79039&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
>>>> +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Fri Aug 14  
>>>> 15:48:13 2009
>>>> @@ -440,6 +440,13 @@
>>>>        MFI->isFrameAddressTaken());
>>>> }
>>>>
>>>> +bool ARMBaseRegisterInfo::hasStackFrame(const MachineFunction  
>>>> &MF) const {
>>>> +  const MachineFrameInfo *MFI = MF.getFrameInfo();
>>>> +  if (NoFramePointerElim && MFI->hasCalls())
>>>> +    return true;
>>>> +  return MFI->hasVarSizedObjects() || MFI->isFrameAddressTaken();
>>>> +}
>>>> +
>>>> /// estimateStackSize - Estimate and return the size of the frame.
>>>> static unsigned estimateStackSize(MachineFunction &MF,  
>>>> MachineFrameInfo *MFI) {
>>>> const MachineFrameInfo *FFI = MF.getFrameInfo();
>>>> @@ -589,7 +596,7 @@
>>>> }
>>>>
>>>> bool ExtraCSSpill = false;
>>>> -  if (!CanEliminateFrame || hasFP(MF)) {
>>>> +  if (!CanEliminateFrame || hasStackFrame(MF)) {
>>>>  AFI->setHasStackFrame(true);
>>>>
>>>>  // If LR is not spilled, but at least one of R4, R5, R6, and R7  
>>>> is spilled.
>>>>
>>>> Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h?rev=79039&r1=79038&r2=79039&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h (original)
>>>> +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Fri Aug 14  
>>>> 15:48:13 2009
>>>> @@ -89,6 +89,8 @@
>>>>
>>>> bool hasFP(const MachineFunction &MF) const;
>>>>
>>>> +  bool hasStackFrame(const MachineFunction &MF) const;
>>>> +
>>>> void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
>>>>                                          RegScavenger *RS = NULL)  
>>>> const;
>>>>
>>>>
>>>> Added: llvm/trunk/test/CodeGen/Thumb2/frameless.ll
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/frameless.ll?rev=79039&view=auto
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- llvm/trunk/test/CodeGen/Thumb2/frameless.ll (added)
>>>> +++ llvm/trunk/test/CodeGen/Thumb2/frameless.ll Fri Aug 14  
>>>> 15:48:13 2009
>>>> @@ -0,0 +1,6 @@
>>>> +; RUN: llvm-as < %s | llc -mtriple=thumbv7-apple-darwin -disable- 
>>>> fp-elim | not grep mov
>>>> +; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux -disable-fp- 
>>>> elim | not grep mov
>>>> +
>>>> +define arm_apcscc void @t() nounwind readnone {
>>>> +  ret void
>>>> +}
>>>>
>>>>
>>>> _______________________________________________
>>>> 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