<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="blue">
<div class="Section1">
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Attached is a small patch to allow users of the PBQP allocator to optionally insert a custom pass. I believe it can be usefull to other
 users of the pbqp.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">I used it to undo some of the coalescer work, and make sure that I have different virtual registers, inserting a copy if necessary, to
 build a pair.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">I noticed an unexpected --- to me at least --- behaviour of the allocator.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">I have some instructions using 2 pairs of registers, say “mpra R_x, R_x+1, R_y, R_y+1”, and setting the pairing constraints R_x -> R_x+1
 and R_y -> R_y+1 could silently produce wrong code like “mpra %R0, %R2, %R1, %R3”. I add to explicitly add another constraint  to describe that y must differ from x, x-1 and x+1 to make the allocator build valid pairs, i.e “mpra %R0, %R1, %R2, %R3”. Is there
 anything I missed ?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Now, 99% of my users’ codebase is compiling.
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">J</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy"><o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">The last issue I have is an assert during regalloc in LiveIntervalAnalysis : “attempt to spill already spilled interval!”, and I do not
 know where to start looking. Any hint would be welcome.<o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">Regards,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">--
<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">Arnaud de Grandmaison
<o:p></o:p></span></font></p>
</div>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">
<hr size="2" width="100%" align="center" tabindex="-1">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size:10.0pt;
font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma"> Lang Hames [mailto:lhames@gmail.com]
<br>
<b><span style="font-weight:bold">Sent:</span></b> Tuesday, June 07, 2011 11:20 AM<br>
<b><span style="font-weight:bold">To:</span></b> Arnaud Allard de Grandmaison<br>
<b><span style="font-weight:bold">Cc:</span></b> Jakob Stoklund Olesen; Peter Lawrence; llvmdev@cs.uiuc.edu<br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [LLVMdev] PBQP & register pairing</span></font><o:p></o:p></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">Hi Arnaud,<o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">That sounds great. I look forward to seeing a patch.<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">You may also look forward to big performance improvements in the PBQP allocator: I'm working on updates which will improve compile speeds and massively reduce memory
 use.<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">Regards,<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">Lang.<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">On Tue, Jun 7, 2011 at 7:02 PM, Arnaud Allard de Grandmaison <<a href="mailto:Arnaud.AllardDeGrandMaison@dibcom.com">Arnaud.AllardDeGrandMaison@dibcom.com</a>> wrote:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><br>
I also considered this approach, but did not want to dive in the constraint handling for now.<br>
<br>
The PBQP path seemed easier at first sight --- and was easy to setup. And I always wanted to give a try to the pbqp :)<br>
<br>
I will add the hook to the pbqp and propose a patch if this looks clean enough.<br>
<br>
Thanks,<br>
--<br>
Arnaud de Grandmaison<o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><br>
-----Original Message-----<br>
From: Jakob Stoklund Olesen [mailto:<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>]<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">Sent: Monday, June 06, 2011 9:28 PM<br>
To: Peter Lawrence<br>
Cc: Arnaud Allard de Grandmaison; <a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><br>
Subject: Re: [LLVMdev] PBQP & register pairing<br>
<br>
<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">On Jun 6, 2011, at 12:14 PM, Peter Lawrence wrote:<br>
<br>
> Arnaud,<br>
>                another way to look at it, if the description of your register sets includes "pairs",<br>
> is that your assembly language syntax for MPQD is redundant, operand-2 is the second<br>
> half of the register-pair in operand-0,  so an alternative is to let llvm think this is a two<br>
> operand instruction (one of them being a pair) rather than a three operand instruction.<br>
><br>
> even if you are not currently defining pairs in your register definitions, it might be less work<br>
> to do that than to write and add an extra new pass.  Many many target machines have some<br>
> notion of register pairs, so it should not be too hard to find examples of how to do this.<br>
<br>
ARM's QQ and QQQQ register classes are examples.<br>
<br>
It is currently a bit tedious to specify these constraints; cleaning that up is on my todo list.<br>
<br>
/jakob<br>
<br>
<o:p></o:p></span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">CONFIDENTIAL NOTICE: The contents of this message, including any attachments, are confidential and are intended solely for the use of the person or entity to whom the
 message was addressed. If you are not the intended recipient of this message, please be advised that any dissemination, distribution, or use of the contents of this message is strictly prohibited. If you received this message in error, please notify the sender.
 Please also permanently delete all copies of the original message and any attached documentation. Thank you.<o:p></o:p></span></font></p>
<div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">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><o:p></o:p></span></font></p>
</div>
</div>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="-2">CONFIDENTIAL NOTICE: The contents of this message, including any attachments, are confidential and are intended solely for the use of the person or entity to whom the message was addressed. If you are not the intended
 recipient of this message, please be advised that any dissemination, distribution, or use of the contents of this message is strictly prohibited. If you received this message in error, please notify the sender. Please also permanently delete all copies of
 the original message and any attached documentation. Thank you.<br>
</font>
</body>
</html>