<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Alex,
<div class=""><br class="">
</div>
<div class="">The correct list for this is <a href="mailto:llvm-dev@lists.llvm" class="">
llvm-dev@lists.llvm</a>.org. I’d CC them but it’s probably best you just re-send your email there so it arrives with full context.</div>
<div class=""><br class="">
</div>
<div class="">James<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 16 Nov 2015, at 11:04, Alex Turjan via llvm-bugs <<a href="mailto:llvm-bugs@lists.llvm.org" class="">llvm-bugs@lists.llvm.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">
<div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px;" class="">
<pre id="yui_3_16_0_1_1447671334933_2753" class="">Hi all,</pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">I'm currently building a vliw port based on a llvm 3.5.0 from 2014, where I have enabled the MachineScheduler to run bottom up. </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">I see that there is an issue with respect to the moment when instructions move from pending to ready. </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">Namely instructions which should still be pending become ready too earlysuch that I end up with true dependent instructions being issued at the same cycle.I think the issue comes from ScheduleDAGMILive::schedule() function. </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">Inside it the updating of the queues happens before SchedImpl->schedNode(SU, IsTopNode) is being called while should have happened after.</pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">See bellow the code fragment where perhaps the call from 1020 should be after line 1032:</pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">1020: updateQueues(SU, IsTopNode); </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">   if (DFSResult) { </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">   unsigned SubtreeID = DFSResult->getSubtreeID(SU); </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">   if (!ScheduledTrees.test(SubtreeID)) { </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">      ScheduledTrees.set(SubtreeID); </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">      DFSResult->scheduleTree(SubtreeID); </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">      SchedImpl->scheduleTree(SubtreeID); </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">   } </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">} </pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">// Notify the scheduling strategy after updating the DAG.</pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">1032: SchedImpl->schedNode(SU, IsTopNode);
<br class=""></pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">The MachineScheduler.cpp file that I use in my port you can see here:<a href="http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/lib/CodeGen/MachineScheduler.cpp?revision=215011&view=markup" id="yui_3_16_0_1_1447671334933_2755" class="">http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/lib/CodeGen/MachineScheduler.cpp?revision=215011&view=markup</a>

For oo machines the issue that I observe wont trigger a bug but in my case as im porting llvmto a vliw (where i produce bundles) instructions becoming ready too early leads to incorrect code. However for oo machines I think this issue may induce a performance 
loss as less instructions that can be issued in parallel endup up next to each other.</pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class=""><br class=""></pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">thanks,</pre>
<pre id="yui_3_16_0_1_1447671334933_2753" class="">Alex</pre>
</div>
</div>
_______________________________________________<br class="">
llvm-bugs mailing list<br class="">
<a href="mailto:llvm-bugs@lists.llvm.org" class="">llvm-bugs@lists.llvm.org</a><br class="">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<hr>
<font face="Arial" color="Black" size="2"><br>
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any
 purpose, or store or copy the information in any medium. Thank you.<br>
</font>
</body>
</html>