[llvm-dev] [RFC][Scheduling] Insert NOPs &&dual issue MIs based on the new MIScheduler

Tony Jiang via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 23 15:00:36 PDT 2020


Hi All,

I am currently investigating how to insert NOPs and dual issue MIs based on
the new llvm MIScheduler.
And encountered several issues requires help from the community.

*First*, I thought I could rely on the HazardRecoginer to help me decide
when I should insert the NOPs. But we
want to use the new MachineSchedModel instead of the legacy Itinerary based
model. That means we
won't define Itinerary model in our backend. Does that mean I cannot use
the HazardRecoginzer llvm
frame code to help me decide when to insert NOPs? i.e: I need people to
help me confirm: whether it
is possible to use the LLVM HazardRecoginzer to help deciding when to
insert NOPs without defining
Itinerary info? Since it seems the following code says without
Itineraries,HazardRecognizer will be disabled.
 If that's the case, what should I do to insert NOPs? I also looked  ARM
backend, it doesn't override the
insertNoop() function, does that mean ARM hardware can automatically stall
when NOP is needed?
Therefore, no need for the compiler to insert NOPs?  I also looked at
Hexagon code, it does override the
the insertNoop() function. But it seems that was invoked through the old *list
scheduler *rather than the new
MIScheduler. And also Hexagon does define *Itinerary *in their
MachineSchedModel. This confuses me,
does this mean the new MachineSchedModel can work together with the old
Itinerary model? Is that the
best  way to do scheduling modeling? I was assuming the community now
recommend people to use the
new MIScheduler + new MachineScheModel for new target development. And
there is also a stand-alone
postRA hazard recognizer which runs the hazard recoginzer and emits noops
when necessary. It gives targets
 a way to run the hazard recognizer without running one of the schedulers.
Should I explore that one instead?

// Initialize the HazardRecognizers. If itineraries don't exist, are empty,
or
2728  // are disabled, then these HazardRecs will be disabled.
2729  const InstrItineraryData
<https://llvm.org/doxygen/classllvm_1_1InstrItineraryData.html> *Itin =
SchedModel->getInstrItineraries();
2730  if (!Top.HazardRec) {
2731  Top.HazardRec =
2732  DAG->MF.getSubtarget().getInstrInfo()->CreateTargetMIHazardRecognizer(
2733  Itin, DAG);
2734  }
2735  if (!Bot.HazardRec) {
2736  Bot.HazardRec =
2737  DAG->MF.getSubtarget().getInstrInfo()->CreateTargetMIHazardRecognizer(
2738  Itin, DAG);
2739  }



*Second*, about dual issue. How does MIScheduler handle dual issue vs
single issue? The only thing that I found
was *IssueWidth*,which should be set to 2 if dual issue, and 1 if single
issue.

Any comments and suggestions will be greatly appreciated, thanks!


Regards,

Yanjun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200323/717bee13/attachment.html>


More information about the llvm-dev mailing list