<div dir="ltr">Hi All,<div><br></div><div>I am currently investigating how to insert NOPs and dual issue MIs based on the new llvm MIScheduler. </div><div>And encountered several issues requires help from the community.</div><div><br></div><div><b>First</b>, I thought I could rely on the HazardRecoginer to help me decide when I should insert the NOPs. But we</div><div>want to use the new MachineSchedModel instead of the legacy Itinerary based model. That means we</div><div>won't define Itinerary model in our backend. Does that mean I cannot use the HazardRecoginzer llvm</div><div>frame code to help me decide when to insert NOPs? i.e: I need people to help me confirm: whether it </div><div>is possible to use the LLVM HazardRecoginzer to help deciding when to insert NOPs without defining </div><div>Itinerary info? Since it seems the following code says without Itineraries,HazardRecognizer will be disabled.</div><div> If that's the case, what should I do to insert NOPs? I also looked  ARM backend, it doesn't override the </div><div>insertNoop() function, does that mean ARM hardware can automatically stall when NOP is needed? </div><div>Therefore, no need for the compiler to insert NOPs?  I also looked at Hexagon code, it does override the</div><div>the insertNoop() function. But it seems that was invoked through the old <b>list scheduler </b>rather than the new</div><div>MIScheduler. And also Hexagon does define <b>Itinerary </b>in their MachineSchedModel. This confuses me,</div><div>does this mean the new MachineSchedModel can work together with the old Itinerary model? Is that the </div><div>best  way to do scheduling modeling? I was assuming the community now recommend people to use the</div><div>new MIScheduler + new MachineScheModel for new target development. And  there is also a stand-alone </div><div>postRA hazard recognizer which runs the hazard recoginzer and emits noops when necessary. It gives targets</div><div> a way to run the hazard recognizer without running one of the schedulers. Should I explore that one instead?</div><div><br></div><div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><span class="gmail-comment" style="color:rgb(128,0,0)">          // Initialize the HazardRecognizers. If itineraries don't exist, are empty, or</span></div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02728" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2728</span>   <span class="gmail-comment" style="color:rgb(128,0,0)">// are disabled, then these HazardRecs will be disabled.</span></div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02729" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2729</span>   <span class="gmail-keyword" style="color:rgb(0,128,0)">const</span> <a class="gmail-code" href="https://llvm.org/doxygen/classllvm_1_1InstrItineraryData.html" style="color:rgb(70,101,162);text-decoration-line:none">InstrItineraryData</a> *Itin = SchedModel->getInstrItineraries();</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02730" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2730</span>   <span class="gmail-keywordflow" style="color:rgb(224,128,0)">if</span> (!Top.HazardRec) {</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02731" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2731</span>     Top.HazardRec =</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02732" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2732</span>         DAG->MF.getSubtarget().getInstrInfo()->CreateTargetMIHazardRecognizer(</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02733" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2733</span>             Itin, DAG);</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02734" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2734</span>   }</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02735" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2735</span>   <span class="gmail-keywordflow" style="color:rgb(224,128,0)">if</span> (!Bot.HazardRec) {</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02736" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2736</span>     Bot.HazardRec =</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02737" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2737</span>         DAG->MF.getSubtarget().getInstrInfo()->CreateTargetMIHazardRecognizer(</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02738" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2738</span>             Itin, DAG);</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="l02739" style="color:rgb(61,87,140)"></a><span class="gmail-lineno" style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre"> 2739</span>   }</div></div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><br></div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><br></div><div><br></div><div><b>Second</b>, about dual issue. How does MIScheduler handle dual issue vs single issue? The only thing that I found</div><div>was <span style="color:rgb(0,0,0);white-space:pre-wrap"><i>IssueWidth</i>,which should be set to 2 if dual issue, and 1 if single issue. </span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">Any comments and suggestions will be greatly appreciated, thanks!</span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">Regards,</span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">Yanjun</span></div><div><br class="gmail-Apple-interchange-newline"></div></div>