<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:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:tax="http://schemas.microsoft.com/sharepoint/taxonomy/soap/" xmlns:tns="http://schemas.microsoft.com/sharepoint/soap/recordsrepository/" xmlns:spsup="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:st="" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Microsoft Sans Serif";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Monospace;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText">Hi,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I’m still missing something on the operations used by the DAG Pattern ISel state machine, in particular operations like  ‘OPC_EmitMergeInputChains’.<o:p></o:p></p>
<p class="MsoPlainText">I’ve define an architecture specific intrinsic mapping to the target NOP operation, like this:  <o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">def         : Pat<(int_clp_nop),       (NOP)>;<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">In many ‘contexts’, it works perfectly. But prior to ‘TokenFactor’ it fails as in following example:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Total amount of phi nodes to update: 2<o:p></o:p></p>
<p class="MsoPlainText">Node 0 : (0x31d8508, 2147483651)<o:p></o:p></p>
<p class="MsoPlainText">Node 1 : (0x31d8568, 2147483652)<o:p></o:p></p>
<p class="MsoPlainText">Initial selection DAG: BB#1 '_start:while.body'<o:p></o:p></p>
<p class="MsoPlainText">SelectionDAG has 24 nodes:<o:p></o:p></p>
<p class="MsoPlainText">  t0: ch = EntryToken<o:p></o:p></p>
<p class="MsoPlainText">  <span lang="FR-BE">t4: i32,ch = CopyFromReg t0, Register:i32 %vreg1<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">    t12: i32,ch = CopyFromReg t0, Register:i32 %vreg0<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">  t13: i32 = add t12, t4<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">        t15: ch = CopyToReg t0, Register:i32 %vreg2, t13<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">                t5: ch = llvm.clp.writeapb.i32 t0, TargetConstant:i16<398>, Constant:i32<24574>, t4<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">              t7: ch = llvm.clp.nop t5, TargetConstant:i16<390><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">            t8: ch = llvm.clp.nop t7, TargetConstant:i16<390><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">          t9: ch = llvm.clp.nop t8, TargetConstant:i16<390><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE" style="color:red">        t10: ch = llvm.clp.nop t9, TargetConstant:i16<390><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">      <span style="background:yellow;mso-highlight:yellow">
t20: ch = TokenFactor t15, t10</span><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">      t18: i1 = setcc t13, Constant:i32<100>, setlt:ch<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">    </span>t21: ch = brcond t20, t18, BasicBlock:ch<while.body 0x31d8458><o:p></o:p></p>
<p class="MsoPlainText">  t23: ch = br t21, BasicBlock:ch<while.end 0x31d85c8><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Selecting: t20: ch = TokenFactor t15, t10<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Selecting: t10: ch = llvm.clp.nop t9, TargetConstant:i16<390><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">ISEL: Starting pattern match on root node: t10: ch = llvm.clp.nop t9, TargetConstant:i16<390><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">  Initial Opcode index to 5<o:p></o:p></p>
<p class="MsoPlainText">  Skipped scope entry (due to false predicate) at index 8, continuing at 44<o:p></o:p></p>
<p class="MsoPlainText">  Skipped scope entry (due to false predicate) at index 45, continuing at 68<o:p></o:p></p>
<p class="MsoPlainText">  Skipped scope entry (due to false predicate) at index 69, continuing at 92<o:p></o:p></p>
<p class="MsoPlainText">  Skipped scope entry (due to false predicate) at index 93, continuing at 116<o:p></o:p></p>
<p class="MsoPlainText"><span style="color:red">  Match failed at index 120<o:p></o:p></span></p>
<p class="MsoPlainText">  Continuing at 127<o:p></o:p></p>
<p class="MsoPlainText">  Match failed at index 128<o:p></o:p></p>
<p class="MsoPlainText">…<o:p></o:p></p>
<p class="MsoPlainText"><span style="color:red">LLVM ERROR: Cannot select: intrinsic %llvm.clp.nop<o:p></o:p></span></p>
<p class="MsoPlainText">------<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I was expecting a match and a morphing to CLP::NOP at line 121.<o:p></o:p></p>
<p class="MsoPlainText">While investigating the cause in the SelectCode MatcherTable[], it fails on ‘OPC_emitMergInputsChains’.<o:p></o:p></p>
<p class="MsoPlainText">While viewing the dag-combine1-dags graph, the TokenFactor has two chains (blue dashed lines).<o:p></o:p></p>
<p class="MsoPlainText">Is it the cause of the failure? Why such TokenFactor are introduced? Where/how are they removed?<o:p></o:p></p>
<p class="MsoPlainText">Do I have to define something else in my Pattern<> or in the NOP Instruction<>?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">------<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">/*116*/</span><span style="font-size:10.0pt;font-family:Monospace;color:black">      
</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">/*Scope*/</span><span style="font-size:10.0pt;font-family:Monospace;color:black"> 10,
</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">/*->127*/</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">/*117*/</span><span style="font-size:10.0pt;font-family:Monospace;color:black">        
<u>OPC_CheckChild1Integer</u>, 6|128,3</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">/*390*/</span><span style="font-size:10.0pt;font-family:Monospace;color:black">,
</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">/*120*/</span><span style="font-size:10.0pt;font-family:Monospace;color:black">        
<u><span style="background:silver;mso-highlight:silver">OPC_EmitMergeInputChains1_0</span></u>,</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">/*121*/</span><span style="font-size:10.0pt;font-family:Monospace;color:black">        
<u>OPC_MorphNodeTo</u>, TARGET_VAL(<u>CLP::NOP</u>), 0|<u>OPFL_Chain</u>,</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">                    0</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">/*#VTs*/</span><span style="font-size:10.0pt;font-family:Monospace;color:black">,
 0</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">/*#<u>Ops</u>*/</span><span style="font-size:10.0pt;font-family:Monospace;color:black">,
</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">                </span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">//
<u>Src</u>: (intrinsic_void 390:iPTR) - Complexity = 8</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">               
</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">// <u>Dst</u>: (NOP)</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">TIA,        Dominique T.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><span lang="FR-BE">Dominique Torette<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">System Architect<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-BE">Rue des Chasseurs Ardennais - Liège Science Park - B-4031 Angleur<o:p></o:p></span></p>
<p class="MsoPlainText">Tel: +32 (0) 4 361 81 11 - Fax: +32 (0) 4 361 81 20<o:p></o:p></p>
<p class="MsoPlainText">www.spacebel.be<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><span lang="FR-BE"><o:p> </o:p></span></p>
</div>
<br clear="both">
 ------------------------------------------------------------------------------<BR>
<BR>
E-MAIL DISCLAIMER<BR>
<BR>
The present message may contain confidential and/or legally privileged information. If you are not the intended addressee and in case of a transmission error, please notify the sender immediately and destroy this E-mail. Disclosure, reproduction or distribution of this document and its possible attachments is strictly forbidden.<BR>
<BR>
SPACEBEL denies all liability for incomplete, improper, inaccurate, intercepted, (partly) destroyed, lost and/or belated transmission of the current information given that unencrypted electronic transmission cannot currently be guaranteed to be secure or error free.<BR>
Upon request or in conformity with formal, contractual agreements, an originally signed hard copy will be sent to you to confirm the information contained in this E-mail.<BR>
<BR>
SPACEBEL denies all liability where E-mail is used for private use.<BR>
<BR>
SPACEBEL cannot be held responsible for possible viruses that might corrupt this message and/or your computer system.<BR>
 -------------------------------------------------------------------------------<BR>
</body>
</html>