Lines Matching refs:dag
66 // DAG subtrees must have at least this many nodes.
181 /// consistent with the DAG builder, which traverses the interior of the
184 /// This design avoids exposing scheduling boundaries to the DAG builder,
185 /// simplifying the DAG builder's support for "special" target instructions.
236 // boundary at the bottom of the region. The DAG does not include RegionEnd,
535 /// only includes instructions that have DAG nodes, not scheduling boundaries.
553 // Initialize the strategy before modifying the DAG.
561 // Initialize ready queues now that the DAG and priority data are finalized.
586 /// Build the DAG and setup three register pressure trackers.
596 // Build the DAG, and compute current register pressure.
640 /// Identify DAG roots and setup scheduler queues.
646 // Release all DAG roots for scheduling, not including EntrySU/ExitSU.
733 // Notify the scheduling strategy after updating the DAG.
772 // LoadClusterMutation - DAG post-processing to cluster loads.
776 /// \brief Post-process the DAG to create cluster edges between neighboring
796 virtual void apply(ScheduleDAGMI *DAG);
798 void clusterNeighboringLoads(ArrayRef<SUnit*> Loads, ScheduleDAGMI *DAG);
811 ScheduleDAGMI *DAG) {
833 && DAG->addEdge(SUb, SDep(SUa, SDep::Cluster))) {
846 DAG->addEdge(SI->getSUnit(), SDep(SUb, SDep::Artificial));
855 /// \brief Callback from DAG postProcessing to create cluster edges for loads.
856 void LoadClusterMutation::apply(ScheduleDAGMI *DAG) {
857 // Map DAG NodeNum to store chain ID.
861 for (unsigned Idx = 0, End = DAG->SUnits.size(); Idx != End; ++Idx) {
862 SUnit *SU = &DAG->SUnits[Idx];
865 unsigned ChainPredID = DAG->SUnits.size();
884 clusterNeighboringLoads(StoreChainDependents[Idx], DAG);
888 // MacroFusion - DAG post-processing to encourage fusion of macro ops.
892 /// \brief Post-process the DAG to create cluster edges between instructions
899 virtual void apply(ScheduleDAGMI *DAG);
903 /// \brief Callback from DAG postProcessing to create cluster edges to encourage
905 void MacroFusion::apply(ScheduleDAGMI *DAG) {
907 MachineInstr *Branch = DAG->ExitSU.getInstr();
911 for (unsigned Idx = DAG->SUnits.size(); Idx > 0;) {
912 SUnit *SU = &DAG->SUnits[--Idx];
922 bool Success = DAG->addEdge(&DAG->ExitSU, SDep(SU, SDep::Cluster));
924 assert(Success && "No DAG nodes should be reachable from ExitSU");
932 // CopyConstrain - DAG post-processing to encourage copy elimination.
936 /// \brief Post-process the DAG to create weak edges from all uses of a copy to
948 virtual void apply(ScheduleDAGMI *DAG);
951 void constrainLocalCopy(SUnit *CopySU, ScheduleDAGMI *DAG);
974 void CopyConstrain::constrainLocalCopy(SUnit *CopySU, ScheduleDAGMI *DAG) {
975 LiveIntervals *LIS = DAG->getLIS();
1043 SUnit *GlobalSU = DAG->getSUnit(GlobalDef);
1052 SUnit *LastLocalSU = DAG->getSUnit(LastLocalDef);
1060 if (!DAG->canAddEdge(GlobalSU, I->getSUnit()))
1069 SUnit *FirstLocalSU = DAG->getSUnit(FirstLocalDef);
1076 if (!DAG->canAddEdge(FirstLocalSU, I->getSUnit()))
1086 DAG->addEdge(GlobalSU, SDep(*I, SDep::Weak));
1092 DAG->addEdge(FirstLocalSU, SDep(*I, SDep::Weak));
1096 /// \brief Callback from DAG postProcessing to create weak edges to encourage
1098 void CopyConstrain::apply(ScheduleDAGMI *DAG) {
1099 MachineBasicBlock::iterator FirstPos = nextIfDebug(DAG->begin(), DAG->end());
1100 if (FirstPos == DAG->end())
1102 RegionBeginIdx = DAG->getLIS()->getInstructionIndex(&*FirstPos);
1103 RegionEndIdx = DAG->getLIS()->getInstructionIndex(
1104 &*priorNonDebug(DAG->end(), DAG->begin()));
1106 for (unsigned Idx = 0, End = DAG->SUnits.size(); Idx != End; ++Idx) {
1107 SUnit *SU = &DAG->SUnits[Idx];
1111 constrainLocalCopy(SU, DAG);
1200 void initResourceDelta(const ScheduleDAGMI *DAG,
1206 // Critical path through the DAG in expected latency.
1223 void init(ScheduleDAGMI *DAG, const TargetSchedModel *SchedModel);
1230 ScheduleDAGMI *DAG;
1290 // A new HazardRec is created for each DAG and owned by SchedBoundary.
1318 DAG(0), SchedModel(0), Rem(0), Available(ID, Name+".A"),
1326 void init(ScheduleDAGMI *dag, const TargetSchedModel *smodel,
1402 ScheduleDAGMI *DAG;
1420 DAG(0), SchedModel(0), TRI(0), Top(TopQID, "TopQ"), Bot(BotQID, "BotQ") {}
1422 virtual void initialize(ScheduleDAGMI *dag);
1456 init(ScheduleDAGMI *DAG, const TargetSchedModel *SchedModel) {
1462 I = DAG->SUnits.begin(), E = DAG->SUnits.end(); I != E; ++I) {
1463 const MCSchedClassDesc *SC = DAG->getSchedClass(&*I);
1477 init(ScheduleDAGMI *dag, const TargetSchedModel *smodel, SchedRemainder *rem) {
1479 DAG = dag;
1486 void ConvergingScheduler::initialize(ScheduleDAGMI *dag) {
1487 DAG = dag;
1488 SchedModel = DAG->getSchedModel();
1489 TRI = DAG->TRI;
1491 Rem.init(DAG, SchedModel);
1492 Top.init(DAG, SchedModel, &Rem);
1493 Bot.init(DAG, SchedModel, &Rem);
1500 const TargetMachine &TM = DAG->MF.getTarget();
1501 Top.HazardRec = TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
1502 Bot.HazardRec = TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
1549 Rem.CriticalPath = DAG->ExitSU.getDepth();
1800 const MCSchedClassDesc *SC = DAG->getSchedClass(SU);
1989 initResourceDelta(const ScheduleDAGMI *DAG,
1994 const MCSchedClassDesc *SC = DAG->getSchedClass(SU);
2116 DAG->getRegionCriticalPSets(),
2117 DAG->getRegPressure().MaxSetPressure);
2146 // the scheduler pass by combining the loads during DAG postprocessing.
2148 Zone.isTop() ? DAG->getNextClusterSucc() : DAG->getNextClusterPred();
2165 TryCand.initResourceDelta(DAG, SchedModel);
2291 /// DAG building. To adjust for the current scheduling location we need to
2311 TryCand.initResourceDelta(DAG, SchedModel);
2345 pickNodeFromQueue(Bot, DAG->getBotRPTracker(), BotCand);
2364 pickNodeFromQueue(Top, DAG->getTopRPTracker(), TopCand);
2381 if (DAG->top() == DAG->bottom()) {
2393 pickNodeFromQueue(Top, DAG->getTopRPTracker(), TopCand);
2404 pickNodeFromQueue(Bot, DAG->getBotRPTracker(), BotCand);
2444 I->getSUnit()->dump(DAG));
2445 DAG->moveInstruction(Copy, InsertPos);
2475 ScheduleDAGMI *DAG = new ScheduleDAGMI(C, new ConvergingScheduler());
2476 // Register DAG post-processors.
2481 DAG->addMutation(new CopyConstrain(DAG->TII, DAG->TRI));
2483 DAG->addMutation(new LoadClusterMutation(DAG->TII, DAG->TRI));
2485 DAG->addMutation(new MacroFusion(DAG->TII));
2486 return DAG;
2541 ScheduleDAGMI *DAG;
2546 ILPScheduler(bool MaximizeILP): DAG(0), Cmp(MaximizeILP) {}
2548 virtual void initialize(ScheduleDAGMI *dag) {
2549 DAG = dag;
2550 DAG->computeDFSResult();
2551 Cmp.DFSResult = DAG->getDFSResult();
2552 Cmp.ScheduledTrees = &DAG->getScheduledTrees();
2572 << " ILP: " << DAG->getDFSResult()->getILP(SU)
2573 << " Tree: " << DAG->getDFSResult()->getSubtreeID(SU) << " @"
2574 << DAG->getDFSResult()->getSubtreeLevel(
2575 DAG->getDFSResult()->getSubtreeID(SU)) << '\n'
2770 /// viewGraph - Pop up a ghostview window with the reachable parts of the DAG