Lines Matching defs:SU

46 getNumDecoderSlots(SUnit *SU) const {
47 const MCSchedClassDesc *SC = getSchedClass(SU);
61 unsigned SystemZHazardRecognizer::getCurrCycleIdx(SUnit *SU) const {
66 if (SU != nullptr && !fitsIntoCurrentGroup(SU)) {
77 getHazardType(SUnit *SU, int Stalls) {
78 return (fitsIntoCurrentGroup(SU) ? NoHazard : Hazard);
92 SystemZHazardRecognizer::fitsIntoCurrentGroup(SUnit *SU) const {
93 const MCSchedClassDesc *SC = getSchedClass(SU);
105 if (CurrGroupSize == 2 && has4RegOps(SU->getInstr()))
109 // SU should fit into current group. NumSlots should be 1 or 0,
111 assert ((getNumDecoderSlots(SU) <= 1) && (CurrGroupSize < 3) &&
167 void SystemZHazardRecognizer::dumpSU(SUnit *SU, raw_ostream &OS) const {
168 OS << "SU(" << SU->NodeNum << "):";
169 OS << TII->getName(SU->getInstr()->getOpcode());
171 const MCSchedClassDesc *SC = getSchedClass(SU);
202 if (SU->isUnbuffered)
204 if (has4RegOps(SU->getInstr()))
269 // Update state with SU as the next scheduled unit.
271 EmitInstruction(SUnit *SU) {
272 const MCSchedClassDesc *SC = getSchedClass(SU);
273 LLVM_DEBUG(dbgs() << "++ HazardRecognizer emitting "; dumpSU(SU, dbgs());
277 // If scheduling an SU that must begin a new decoder group, move on
279 if (!fitsIntoCurrentGroup(SU))
283 if (CurGroupDbg.length()) cgd << ", "; dumpSU(SU, cgd););
285 LastEmittedMI = SU->getInstr();
288 if (SU->isCall) {
291 LastEmittedMI = SU->getInstr();
320 if (SU->isUnbuffered) {
321 LastFPdOpCycleIdx = getCurrCycleIdx(SU);
326 // Insert SU into current group by increasing number of slots used
328 CurrGroupSize += getNumDecoderSlots(SU);
329 CurrGroupHas4RegOps |= has4RegOps(SU->getInstr());
331 assert((CurrGroupSize <= GroupLim || CurrGroupSize == getNumDecoderSlots(SU))
332 && "SU does not fit into decoder group!");
340 int SystemZHazardRecognizer::groupingCost(SUnit *SU) const {
341 const MCSchedClassDesc *SC = getSchedClass(SU);
345 // If SU begins new group, it can either break a current group early
353 // Similarly, a group-ending SU may either fit well (last in group), or
357 (CurrGroupSize + getNumDecoderSlots(SU));
364 if (CurrGroupSize == 2 && has4RegOps(SU->getInstr()))
371 bool SystemZHazardRecognizer::isFPdOpPreferred_distance(SUnit *SU) const {
372 assert (SU->isUnbuffered);
380 unsigned SUCycleIdx = getCurrCycleIdx(SU);
387 resourcesCost(SUnit *SU) {
390 const MCSchedClassDesc *SC = getSchedClass(SU);
396 if (SU->isUnbuffered)
397 Cost = (isFPdOpPreferred_distance(SU) ? INT_MIN : INT_MAX);
413 SUnit SU(MI, 0);
416 SU.isCall = MI->isCall();
424 SU.hasReservedResource = true;
427 SU.isUnbuffered = true;
435 EmitInstruction(&SU);