[LLVMdev] Linux/ppc backend

Evan Cheng evan.cheng at apple.com
Wed Feb 14 00:06:58 PST 2007

On Feb 13, 2007, at 9:49 AM, Nicolas Geoffray wrote:

> Hi Chris,
>>> It is marked callee saved. Because when it is not needed as frame
>>> pointer it is used like an ordinary register. But when it is used as
>>> frame pointer, the prologue and epilogue change its value, but the
>>> algorithm in llvm that finds clobbered register does not select it.
>> Okay, I'm not sure.  If you describe the constraints better,  
>> perhaps Jim
>> or Evan will have an idea :)
> Well i believe the algorithm that finds clobbered registers does not
> look at the epilogue
> and prologue, and therefore does not select R31.
> Maybe all I need to do is to explicitly add R31 as a clobbered  
> register
> when it is used
> as a frame pointer. But I need some help to do that.

I am still sure if I understand.  R31 is the PPC frame pointer. Are  
you saying that if frame pointer cannot be eliminated (i.e. hasFP())  
is true, you want to spill it to a particular stack slot? You can  
override the default  
MRegisterInfo::processFunctionBeforeCalleeSavedScan() implementation  
and force it to be spilled. Take a look at ARMRegisterInfo.cpp for an  


> Thx,
> Nicolas
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

More information about the llvm-dev mailing list