<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" 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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello there!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Can I please get some feedback on the following plan?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">---<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Plan to patch the split_unique_types method to make it able to create<o:p></o:p></p>
<p class="MsoNormal">unique types for inputs participating in NoEscape merges. The motivation for<o:p></o:p></p>
<p class="MsoNormal">doing this is because it will make possible to remove the allocation merge<o:p></o:p></p>
<p class="MsoNormal">(after making other changes) and scalar replace some of the merge's input. I<o:p></o:p></p>
<p class="MsoNormal">will be concurrently working on a different set of changes to eliminate the<o:p></o:p></p>
<p class="MsoNormal">allocation merges.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My idea is to approach this in three parts. The parts are separated by the type<o:p></o:p></p>
<p class="MsoNormal">of node that uses the allocation merge. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">1) Merges that have only SafePoint (and subclasses) nodes as users. This will<o:p></o:p></p>
<p class="MsoNormal">let me handle merges used as debug information in SafePoints. There are not many<o:p></o:p></p>
<p class="MsoNormal">merges that are only used by SafePoints but SafePointNode is the most common<o:p></o:p></p>
<p class="MsoNormal">user of merges (the merge is used by a SafePointNode and some other type<o:p></o:p></p>
<p class="MsoNormal">of node).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">2) Also handle merges that have field loads as users. This will let me later on<o:p></o:p></p>
<p class="MsoNormal">split-thru-phi the loads and after some other changes remove the merge.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">With (1) and (2) in place many (maybe most) merge usage patterns can be<o:p></o:p></p>
<p class="MsoNormal">simplified. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">3) Also handle merges that have Store as users. This is by far the most<o:p></o:p></p>
<p class="MsoNormal">complicated case. It might not be possible to handle this kind of merge in<o:p></o:p></p>
<p class="MsoNormal">general, but we can make some cases work. My current idea for handling this<o:p></o:p></p>
<p class="MsoNormal">scenario is to clone the Store, make each one use a different input from the<o:p></o:p></p>
<p class="MsoNormal">merge and have a different unique type. This will require adding a "selector<o:p></o:p></p>
<p class="MsoNormal">phi" to output which input of the merge should be used and IfNode's to control<o:p></o:p></p>
<p class="MsoNormal">the execution of the cloned Store's. I understand we'll need to limit the number<o:p></o:p></p>
<p class="MsoNormal">of bases and stores that we can handle.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As an illustration of the 3rd scenario above, this code:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">p = phi(x, o1, o2);<o:p></o:p></p>
<p class="MsoNormal">p.x = 10; // no instance_id<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">would become:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">p1 = phi(x, o1, NULL);<o:p></o:p></p>
<p class="MsoNormal">p2 = phi(x, NULL, o2);<o:p></o:p></p>
<p class="MsoNormal">sl = phi(x, 0, 1); // selector Phi<o:p></o:p></p>
<p class="MsoNormal">if (sl == 0)<o:p></o:p></p>
<p class="MsoNormal"> p1.x = 10; // instance_id "1"<o:p></o:p></p>
<p class="MsoNormal">else<o:p></o:p></p>
<p class="MsoNormal"> p2.x = 10; // instance_id "2"<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal">Cesar<o:p></o:p></p>
</div>
</body>
</html>