<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Revisiting this thread. I have been experimenting with the RDF module on the X86 target. For the most part, building the data-flow graph and following def-use chains seems to work fine. But I am also observing some strange behavior in the phi nodes. For
example, I have one basic block which begins with the following 4 phi nodes:</div>
<div><br>
</div>
<div>b585: --- %bb.25 --- preds(5): %bb.24, %bb.20, %bb.22, %bb.49, %bb.52 succs(2): %bb.18, %bb.37<br>
p1095: phi [+d1096<EBP>(,d668,):, u1097<EBP>(d540,b477):u555, u1098<EBP>(d427,b448):u450, u1099<EBP>(d427,b462):u464, u1100<EBP>(d427,b1009):u1011, u1101<EBP>(d427,b1027):u1029]<br>
p1102: phi [+d1103<R13D>(,,u1075):, u1104<R13D>(d557,b477):u563, u1105<R13D>(d411,b448):, u1106<R13D>(d411,b462):u459, u1107<R13D>(d411,b1009):u1106, u1108<R13D>(d411,b1027):u1107]<br>
p1109: phi [+d1110<R14D>(,d625,u612):, u1111<R14D>(d584,b477):, u1112<R14D>(d452,b448):, u1113<R14D>(d466,b462):, u1114<R14D>(d1013,b1009):, u1115<R14D>(d1031,b1027):]<br>
p1116: phi [+d1117<#1073741833>(,d645,u648):, u1118"<#1073741833>(d579,b477):, u1466"<#1073741833>(d578,b477):, u1467"<#1073741833>(d569,b477):u581, u1468"<#1073741833>(d546,b477):, u1469"<#1073741833>(d543,b477):, u1470"<#1073741833>(d524,b477):u530, u1119"<#1073741833>(d453,b448):,
u1436"<#1073741833>(d420,b448):, u1437"<#1073741833>(d404,b448):u445, u1120"<#1073741833>(d467,b462):, u1438"<#1073741833>(d420,b462):u1436", u1439"<#1073741833>(d404,b462):u473, u1121"<#1073741833>(d1014,b1009):, u1440"<#1073741833>(d420,b1009):u1006, u1441"<#1073741833>(d404,b1009):u1439",
u1122"<#1073741833>(d1032,b1027):, u1442"<#1073741833>(d420,b1027):u1440", u1443"<#1073741833>(d404,b1027):u1441"]</div>
<div><br>
</div>
<div>The first three make perfect sense to me, and seem to reflect the post-allocation MIR correctly. The fourth phi node seems entirely composed of defs and uses for some unnamed register #1073741833 (what exactly is the significance of unnamed registers?).
Moreover, this phi seems to be introducing false def-use relationships into the DFG. For example, the phi introduces the following dependency chain, which as far as I can tell is not valid:</div>
<div><br>
</div>
<div>// R11D is def'ed, def ID is d524</div>
<div>s523: SUB32rr [d524<R11D>(d519,,u1470"):, d525<EFLAGS>!(d520,d533,):, u526<R11D>(d519):, u527<ESI>(d508):]<br>
...</div>
<div>// d524 is used in the phi node to def d1117, corresponding to unnamed register #1073741833<br>
p1116: phi [+d1117<#1073741833>(,d645,u648):, u1118"<#1073741833>(d579,b477):, u1466"<#1073741833>(d578,b477):, u1467"<#1073741833>(d569,b477):u581, u1468"<#1073741833>(d546,b477):, u1469"<#1073741833>(d543,b477):, u1470"<#1073741833>(d524,b477):u530, u1119"<#1073741833>(d453,b448):,
u1436"<#1073741833>(d420,b448):, u1437"<#1073741833>(d404,b448):u445, u1120"<#1073741833>(d467,b462):, u1438"<#1073741833>(d420,b462):u1436", u1439"<#1073741833>(d404,b462):u473, u1121"<#1073741833>(d1014,b1009):, u1440"<#1073741833>(d420,b1009):u1006, u1441"<#1073741833>(d404,b1009):u1439",
u1122"<#1073741833>(d1032,b1027):, u1442"<#1073741833>(d420,b1027):u1440", u1443"<#1073741833>(d404,b1027):u1441"]<br>
...</div>
<div>// d1117 is used in def d645 of register R9D<br>
s644: ADD32rr [d645<R9D>(+d1117,d694,u659):d634, d646<EFLAGS>!(d633,d651,):, u647<R9D>(+d1117):u637, u648<R9D>(+d1117):u647]</div>
<div><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br>
</div>
<div>But after examining the corresponding MIR, I do not think that R11D flows into R9D. So it looks to me as though this phi node is erroneous.</div>
<div><br>
</div>
<div>Any help wold be much appreciated!</div>
<div><br>
</div>
<div>I'm using the LLVM 8.0.1 release.</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Fri, Nov 8, 2019 at 10:35 AM Scott Douglas Constable via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<div>
<div dir="ltr">
<div>Do you know whether it has been fixed on the 8.0.1 release?</div>
<div><br>
</div>
<div>Scott</div>
</div>
<br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Fri, Nov 8, 2019 at 9:45 AM Krzysztof Parzyszek <<a href="mailto:kparzysz@quicinc.com" target="_blank">kparzysz@quicinc.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<div lang="EN-US">
<div>
<p class="MsoNormal">The one blocking issue that existed in the past has been fixed. I haven’t had time to do any work on it lately, but I’m not aware of any fundamental problems that would make it not work on x86.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><span style="font-family:Consolas;font-size:9pt">-- </span><span style="font-family:Consolas;font-size:9pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas;font-size:8pt">Krzysztof Parzyszek
<a href="mailto:kparzysz@quicinc.com" target="_blank"><span style="color:rgb(5,99,193)">kparzysz@quicinc.com</span></a> AI tools development<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-width:medium medium medium 1.5pt;border-style:none none none solid;border-color:currentColor currentColor currentColor blue;padding:0in 0in 0in 4pt">
<div>
<div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(225,225,225) currentColor currentColor;padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>>
<b>On Behalf Of </b>Scott Douglas Constable via llvm-dev<br>
<b>Sent:</b> Friday, November 8, 2019 10:59 AM<br>
<b>To:</b> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<b>Subject:</b> [EXT] [llvm-dev] Register Dataflow Analysis on X86<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="color:rgb(34,34,34);font-family:"Arial",sans-serif;font-size:10pt">I came across this thread from a couple years ago:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(34,34,34);font-family:"Arial",sans-serif;font-size:10pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(34,34,34);font-family:"Arial",sans-serif;font-size:10pt"><a href="http://lists.llvm.org/pipermail/llvm-dev/2017-November/119346.html" target="_blank"><span style="color:rgb(17,85,204)">http://lists.llvm.org/pipermail/llvm-dev/2017-November/119346.html</span></a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(34,34,34);font-family:"Arial",sans-serif;font-size:10pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(34,34,34);font-family:"Arial",sans-serif;font-size:10pt">Has there been any progress on RDF for X86? Or is there some other preferred alternative for performing reachability analysis after register allocation?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(34,34,34);font-family:"Arial",sans-serif;font-size:10pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(34,34,34);font-family:"Arial",sans-serif;font-size:10pt">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(34,34,34);font-family:"Arial",sans-serif;font-size:10pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(34,34,34);font-family:"Arial",sans-serif;font-size:10pt">Scott Constable<u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" rel="noreferrer">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote>
</div>
</body>
</html>