<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 17, 2012, at 5:24 PM, Jafar J <<a href="mailto:pluck90@hotmail.com">pluck90@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div style="font-family: Calibri; font-size: 12pt; ">
<div>Hello,</div>
<div>    <font face="Times New Roman">why LLVM does not define 
physical register limits for MIPS by overriding the 
TargetRegisterInfo::getRegPressureLimit function the way it’s done for X86 in 
x86RegisterInfo.cpp and ARM.</font><span style="font-size: 12pt; "> </span></div></div></div></div></blockquote><br></div><div>Jafar,</div><div><br></div><div>The getRegPressureLimit  hook is still used by the current SelectionDAG instruction scheduler. If that's what you care about, then you need to implement it manually. But there is a new pair of hooks that are now generated automatically for you (pasting bits of MipsGenRegisterInfo.inc below.) You can use these hooks directly. The API is raw because it currently only supports a register tracker utility, but I'll take feedback for improving the API. If you do need the old manual hook, then you can implement it in terms of these auto-generated ones.</div><div><br></div><div>-Andy</div><div><br></div><div><div>// Get the register unit pressure limit for this dimension.</div><div>// This limit must be adjusted dynamically for reserved registers.</div><div>unsigned MipsGenRegisterInfo::</div><div>getRegPressureSetLimit(unsigned Idx) const {</div><div>  static const unsigned PressureLimitTable[] = {</div><div>    32,  <span class="Apple-tab-span" style="white-space:pre">   </span>// 0: CPURegs</div><div>    32,  <span class="Apple-tab-span" style="white-space:pre">        </span>// 1: FGR32</div><div>    8,  <span class="Apple-tab-span" style="white-space:pre">   </span>// 2: CPU16Regs</div><div>    2,  <span class="Apple-tab-span" style="white-space:pre">       </span>// 3: HILO</div><div>    1,  <span class="Apple-tab-span" style="white-space:pre">    </span>// 4: CCR</div><div>    1,  <span class="Apple-tab-span" style="white-space:pre">     </span>// 5: CPURAReg</div><div>    1,  <span class="Apple-tab-span" style="white-space:pre">        </span>// 6: HWRegs</div><div>    1,  <span class="Apple-tab-span" style="white-space:pre">  </span>// 7: HWRegs64</div><div>    0 };</div><div>  return PressureLimitTable[Idx];</div><div>}</div><div><br></div><div>/// Get the dimensions of register pressure impacted by this register class.</div><div>/// Returns a -1 terminated array of pressure set IDs</div><div>const int* MipsGenRegisterInfo::</div><div>getRegClassPressureSets(const TargetRegisterClass *RC) const {</div><div>  static const int RCSetsTable[] = {</div><div>    0,  -1,  <span class="Apple-tab-span" style="white-space:pre">    </span>// CPURegs</div><div>    1,  -1,  <span class="Apple-tab-span" style="white-space:pre">  </span>// FGR32</div><div>    0,  2,  -1,  <span class="Apple-tab-span" style="white-space:pre">   </span>// CPU16Regs</div><div>    3,  -1,  <span class="Apple-tab-span" style="white-space:pre">        </span>// HILO</div><div>    4,  -1,  <span class="Apple-tab-span" style="white-space:pre">     </span>// CCR</div><div>    0,  5,  -1,  <span class="Apple-tab-span" style="white-space:pre">     </span>// CPURAReg</div><div>    6,  -1,  <span class="Apple-tab-span" style="white-space:pre"> </span>// HWRegs</div><div>    7,  -1,  <span class="Apple-tab-span" style="white-space:pre">   </span>// HWRegs64</div><div>    0,  -1,  <span class="Apple-tab-span" style="white-space:pre"> </span>// CPU64Regs</div><div>    1,  -1,  <span class="Apple-tab-span" style="white-space:pre">        </span>// FGR64</div><div>    1,  -1,  <span class="Apple-tab-span" style="white-space:pre">    </span>// AFGR64</div><div>    0,  2,  -1,  <span class="Apple-tab-span" style="white-space:pre">  </span>// CPU64Regs_with_sub_32_in_CPU16Regs</div><div>    3,  -1,  <span class="Apple-tab-span" style="white-space:pre">       </span>// HILO64</div><div>    0,  5,  -1,  <span class="Apple-tab-span" style="white-space:pre">  </span>// CPU64Regs_with_sub_32_in_CPURAReg</div><div>    -1 };</div><div>  static const unsigned RCSetStartTable[] = {</div><div>    0,2,4,7,9,11,14,16,18,20,22,24,27,29,0 };</div><div>  unsigned SetListStart = RCSetStartTable[RC->getID()];</div><div>  return &RCSetsTable[SetListStart];</div><div>}</div><div><br></div></div></body></html>