<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Feb 27, 2007, at 9:29 AM, Nicolas Geoffray wrote:</DIV><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Here's a patch that fixes linux/PPC FramePointer. It reserves the offset of the frame pointer before</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">calculating the offsets of callee saved registers.</DIV></BLOCKQUOTE><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OK to commit?</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Why can't you just mark the frame address callee save?  Why isn't it getting saved automatically for you?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-Chris</DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">Index: PPCRegisterInfo.cpp</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">===================================================================</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">RCS file: /var/cvs/llvm/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp,v</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">retrieving revision 1.114</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">diff -t -d -u -p -5 -r1.114 PPCRegisterInfo.cpp</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">--- PPCRegisterInfo.cpp<SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN>27 Feb 2007 11:55:45 -0000<SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN>1.114</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+++ PPCRegisterInfo.cpp<SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN>27 Feb 2007 17:29:51 -0000</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">@@ -879,10 +879,30 @@ void PPCRegisterInfo::processFunctionBef</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">   </SPAN>//<SPAN class="Apple-converted-space">  </SPAN>Save and clear the LR state.</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">   </SPAN>PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">   </SPAN>unsigned LR = getRARegister();</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">   </SPAN>FI->setUsesLR(MF.isPhysRegUsed(LR));</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">   </SPAN>MF.changePhyRegUsed(LR, false);</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">  </SPAN>//<SPAN class="Apple-converted-space">  </SPAN>Save R31 if necessary</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">  </SPAN>int FPSI = FI->getFramePointerSaveIndex();</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">  </SPAN>bool IsPPC64 = Subtarget.isPPC64();</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">  </SPAN>bool IsMachoABI = Subtarget.isMachoABI();</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">  </SPAN>const MachineFrameInfo *MFI = MF.getFrameInfo();</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">  </SPAN>// If the frame pointer save index hasn't been defined yet.</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">  </SPAN>if (!FPSI &&<SPAN class="Apple-converted-space">  </SPAN>(NoFramePointerElim || MFI->hasVarSizedObjects())<SPAN class="Apple-converted-space"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">                                                  </SPAN>&& !IsMachoABI) {</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>// Find out what the fix offset of the frame pointer save area.</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>int FPOffset = PPCFrameInfo::getFramePointerSaveOffset(IsPPC64,<SPAN class="Apple-converted-space"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">                                                              </SPAN>IsMachoABI);</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>// Allocate the frame index for frame pointer save area.</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>FPSI = MF.getFrameInfo()->CreateFixedObject(IsPPC64? 8 : 4, FPOffset);</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>// Save the result.</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>FI->setFramePointerSaveIndex(FPSI); <SPAN class="Apple-converted-space">                     </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">  </SPAN>}</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>}</FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const {</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">   </SPAN>MachineBasicBlock &MBB = MF.front(); <SPAN class="Apple-converted-space">  </SPAN>// Prolog goes in entry BB</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: 10.0px Monaco"><SPAN class="Apple-converted-space">   </SPAN>MachineBasicBlock::iterator MBBI = MBB.begin();</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">llvm-commits mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>