Hi Jakob,<div><br></div><div>The PBQP allocator should have no problem representing this. Between each pair of address/modification registers that are used together in a post-modification instruction you'll need to add the following cost matrix:<div>
<br></div><div><font class="Apple-style-span" face="'courier new', monospace">    sp  r0</font><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">  r1</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">  r2</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">  r3</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">  r4</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">  r5</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">  r6</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">  r7  r8</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">  r9</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; "> r10</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; "> r11</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; "> r12</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; "> r13</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; "> r14</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; "> r15</span></div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<font class="Apple-style-span" face="'courier new', monospace">sp  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0</font></div><div><font class="Apple-style-span" face="'courier new', monospace">m0  0   0   0   0   0   i   i   i   i   i   i   i   i   i   i   i   i</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">m1  0   i   i   i   i   0   0   0   0   i   i   i   i   i   i   i   i</font></div><div><font class="Apple-style-span" face="'courier new', monospace">m2  0   </font><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">i   i   i   i   i   i   i   i   0   0   0   0   </span><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">i   i   i   i</span></div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><font class="Apple-style-span" face="'courier new', monospace">m3  0   <meta http-equiv="content-type" content="text/html; charset=utf-8">i   i   i   i   i   i   i   i   <meta http-equiv="content-type" content="text/html; charset=utf-8">i   i   i   i   0   0   0   0</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; ">I have been busy with my thesis write-up recently and haven't had time to keep up with progress in the CodeGen framework. Last time I checked it didn't model this kind of constraint. If that's still the case (i.e. it still isn't modeled) then you'll have to derive your own PBQPBuilder in your target and set PBQP to be the default allocator for your system. If the CodeGen framework can represent this kind of pairing constraint now you could add your new PBQPBuilder to  CodeGen so that other target writers can benefit from it.</span></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">See </font><font class="Apple-style-span" face="'courier new', monospace">lib/CodeGen/RegAllocPBQP.cpp</font><font class="Apple-style-span" face="arial, helvetica, sans-serif"> for examples of how to write PBQPBuilders, and I'm happy to answer any questions, time permitting. :)</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Cheers,</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Lang.</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font><br><div class="gmail_quote">On Wed, Apr 27, 2011 at 5:59 PM, Jakob Stengård <span dir="ltr"><<a href="mailto:jakobste@kth.se">jakobste@kth.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">>Can you describe your pairing constraint in more detail? I've seen a few
 different kinds of "pairing", and the approach to supporting them can 
vary.<br><br></div>The stuff im currently looking at is a constraint between address-registers and modification-registers. <br>For example, post modification of r12-r15 can only be done with modification register m3.<br>
The instruction mv *r14++m, a4l must use modification register m3.<br>
<br>They map like this:<br><br><font face="Arial, sans-serif" size="3"><div><font size="2">r0-r3    : m0</font></div>
<div><font size="2">r4-r7    : m1</font></div>
<div><font size="2">r8-r11  : m2</font></div>
<div><font size="2">r12-r15 : m3</font><br>
</div></font><br>/J<div><div></div><div class="h5"><br><br><br><br><div class="gmail_quote">On Wed, Apr 27, 2011 at 2:06 AM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hi Jakob,<div><br></div><div>You're correct: Register pairing is not implemented in PBQP yet.</div><div><br></div><div>Can you describe your pairing constraint in more detail? I've seen a few different kinds of "pairing", and the approach to supporting them can vary.</div>


<div><br></div><div>As a starting point I would look at the <font face="'courier new', monospace">PBQPBuilder</font> class and its derivatives (see <font face="'courier new', monospace">include/llvm/CodeGen/RegAllocPBQP.h, lib/CodeGen/RegAllocPBQP.cpp</font>). You probably need to derive a new PBQPBuilder and have it add matrices representing the pairing constraints. An overview of this is given in <a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-September/034781.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-September/034781.html</a>.</div>


<div><br></div><div>Cheers,</div><div>Lang.<br><br><div class="gmail_quote"><div><div></div><div>On Tue, Apr 26, 2011 at 10:03 PM, Jakob Stengård <span dir="ltr"><<a href="mailto:jakobste@kth.se" target="_blank">jakobste@kth.se</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div>Hi.<br>Im currently investigating LLVM's implementation of PBQP as a part of a bachelors thesis im doing on register allocation for regular architectures.<br>


In particullar, im looking at the possibility for improving the spill rate of PBQP for a particular DSP architecture, by using register pairing.<br>
<br>From reading the source code of lib/CodeGen/RegAllocPBQP.cpp  i conclude that support for register paring is not yet implemented (correct me if im wrong here).<br>However this feature was mentioned as a future goal in a slide i found  <a href="http://llvm.org/devmtg/2009-10/RegisterAllocationFutureWorks.pdf" target="_blank">(http://llvm.org/devmtg/2009-10/RegisterAllocationFutureWorks.pdf</a>).<br>



<br>So im just wondering what the status on this is.<br>Would be interesting from the dev-teams perspective, to get this implemented?<br>Anny ideas on what would be the best way to do that, in case someone (like me) would be interested in doing that?<br>



<br>
Best Regards<br><font color="#888888">Jakob Stengård.
</font><br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div></div>