<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1447336828308_3796"><font id="yui_3_16_0_1_1447336828308_5427" size="3" face="times new roman, new york, times, serif">Hi all,</font></div><div id="yui_3_16_0_1_1447336828308_3796"><font size="3" face="times new roman, new york, times, serif" id="yui_3_16_0_1_1447336828308_5552">I'm currently building a vliw port based on a llvm 3.5.0 from 2014, where </font><span style="font-family: 'times new roman', 'new york', times, serif; font-size: medium;" id="yui_3_16_0_1_1447336828308_5716">I have enabled the MachineScheduler to run bottom up. </span><span style="font-family: 'times new roman', 'new york', times, serif; font-size: medium;">I see that there is an issue with respect to the moment when instructions move from </span></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><font size="3" face="times new roman, new york, times, serif" id="yui_3_16_0_1_1447336828308_5518">pending to ready. Namely instructions which should still be pending become ready too early</font></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><font size="3" face="times new roman, new york, times, serif" id="yui_3_16_0_1_1447336828308_5807">such that I end up with true dependent instructions being issued at the same cycle.</font></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><font size="3" face="times new roman, new york, times, serif" id="yui_3_16_0_1_1447336828308_5519">I think the issue comes from <span class="" id="yui_3_16_0_1_1447336828308_4102" style="white-space: pre-wrap;">ScheduleDAGMILive</span><span class="" id="yui_3_16_0_1_1447336828308_4104" style="color: rgb(102, 102, 102); white-space: pre-wrap;">::</span><span class="" id="yui_3_16_0_1_1447336828308_4106" style="white-space: pre-wrap;">schedule</span><span class="" id="yui_3_16_0_1_1447336828308_4108" style="white-space: pre-wrap;">() function. Inside it</span><span id="yui_3_16_0_1_1447336828308_4110" class="" style="white-space: pre-wrap;"> the updating of the queues </span></font></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><font size="3" face="times new roman, new york, times, serif" id="yui_3_16_0_1_1447336828308_5517"><span class="" style="white-space: pre-wrap;" id="yui_3_16_0_1_1447336828308_5348">happens </span><span class="" style="white-space: pre-wrap;" id="yui_3_16_0_1_1447336828308_5555">before </span><span id="yui_3_16_0_1_1447336828308_4915" class="" style="white-space: pre-wrap;">SchedImpl->schedNode(SU, IsTopNode) is being called while should have happened after.</span></font></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><span class="" style="white-space: pre-wrap;" id="yui_3_16_0_1_1447336828308_5346"><font size="3" face="times new roman, new york, times, serif" id="yui_3_16_0_1_1447336828308_5554">See bellow the code fragment where perhaps the call from 1020 should be after line 1032:</font></span></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><font size="3" face="times new roman, new york, times, serif"><br></font></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><font id="yui_3_16_0_1_1447336828308_5425" size="3" face="times new roman, new york, times, serif"><span class="" style="white-space: pre-wrap;" id="yui_3_16_0_1_1447336828308_4758"><font id="yui_3_16_0_1_1447336828308_4760" class="">1020:    updateQueues(SU, IsTopNode);
         if (DFSResult) {
          unsigned SubtreeID = DFSResult->getSubtreeID(SU);
          if (!ScheduledTrees.test(SubtreeID)) {
            ScheduledTrees.set(SubtreeID);
            DFSResult->scheduleTree(SubtreeID);
            SchedImpl->scheduleTree(SubtreeID);
          }
        }

    // Notify the scheduling strategy after updating the DAG.
1032:  SchedImpl->schedNode(SU, IsTopNode);</font></span><span class="" style="white-space: pre-wrap;">
</span></font></div><div dir="ltr" id="yui_3_16_0_1_1447336828308_4762" class=""><font size="3" face="times new roman, new york, times, serif"><br></font></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><span class="" style="white-space: pre-wrap;" id="yui_3_16_0_1_1447336828308_4502"><font size="3" id="yui_3_16_0_1_1447336828308_5449" face="times new roman, new york, times, serif">The MachineScheduler.cpp file that I use in my port you can see here:</font></span></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><span class="" id="yui_3_16_0_1_1447336828308_4210"><font size="3" id="yui_3_16_0_1_1447336828308_5448" face="times new roman, new york, times, serif"><font id="yui_3_16_0_1_1447336828308_4209" class=""><span style="white-space: pre-wrap;" id="yui_3_16_0_1_1447336828308_4208" class=""><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_1447336828308_4203">http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/lib/CodeGen/MachineScheduler.cpp?revision=215011&view=markup</a></span></font><br></font></span></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><span class="" style="white-space: pre-wrap;"><font size="3" face="times new roman, new york, times, serif"><br></font></span></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><span class="" style="white-space: pre-wrap;" id="yui_3_16_0_1_1447336828308_5349"><font size="3" id="yui_3_16_0_1_1447336828308_5447" face="times new roman, new york, times, serif">For oo machines the issue that I observe wont trigger a bug but in my case as im porting llvm</font></span></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><span class="" style="white-space: pre-wrap;" id="yui_3_16_0_1_1447336828308_5350"><font size="3" id="yui_3_16_0_1_1447336828308_5446" face="times new roman, new york, times, serif">to a vliw (where i produce bundles)  instructions becoming ready too early leads to incorrect code.</font></span></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><span class="" style="white-space: pre-wrap;"><font size="3" face="times new roman, new york, times, serif"><br></font></span></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><span class="" style="white-space: pre-wrap;"><font size="3" face="times new roman, new york, times, serif">thanks,</font></span></div><div id="yui_3_16_0_1_1447336828308_3796" dir="ltr"><span class="" style="white-space: pre-wrap;" id="yui_3_16_0_1_1447336828308_5352"><font id="yui_3_16_0_1_1447336828308_5429" size="3" face="times new roman, new york, times, serif">Alex</font></span></div></div></body></html>