25#define DEBUG_TYPE "post-RA-sched"
34 PrefVectorStoreNew =
nullptr;
41 if (!
MI || TII->isZeroCost(
MI->getOpcode()))
47 if (isNewStore(*
MI)) {
63 if (SU == UsesDotCur && DotCurPNum != (
int)PacketNum) {
64 LLVM_DEBUG(
dbgs() <<
"*** .cur Hazard in cycle " << PacketNum <<
", "
75 if (DotCurPNum != -1 && DotCurPNum != (
int)PacketNum) {
80 PrefVectorStoreNew =
nullptr;
96 if (PrefVectorStoreNew !=
nullptr && PrefVectorStoreNew != SU)
100 return UsesDotCur && ((SU == UsesDotCur) ^ (DotCurPNum == (
int)PacketNum));
123 if (TII->isZeroCost(
MI->getOpcode()))
148 for (
auto &S : SU->
Succs)
149 if (S.isAssignedRegDep() && S.getLatency() == 0 &&
150 S.getSUnit()->NumPredsLeft == 1) {
151 UsesDotCur = S.getSUnit();
152 DotCurPNum = PacketNum;
155 if (SU == UsesDotCur) {
156 UsesDotCur =
nullptr;
160 UsesLoad =
MI->mayLoad();
163 for (
auto &S : SU->
Succs)
164 if (S.isAssignedRegDep() && S.getLatency() == 0 &&
167 PrefVectorStoreNew = S.getSUnit();
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool canReserveResources(const MCInstrDesc *MID)
void reserveResources(const MCInstrDesc *MID)
void Reset() override
This callback is invoked when a new block of instructions is about to be scheduled.
void AdvanceCycle() override
This callback is invoked whenever the next top-down instruction to be scheduled cannot issue in the c...
bool ShouldPreferAnother(SUnit *) override
This callback may be invoked if getHazardType returns NoHazard.
HazardType getHazardType(SUnit *SU, int stalls) override
Return the hazard type of emitting this node.
void EmitInstruction(SUnit *) override
This callback is invoked when an instruction is emitted to be scheduled, to advance the hazard state.
bool mayBeNewStore(const MachineInstr &MI) const
int getDotNewOp(const MachineInstr &MI) const
bool isHVXVec(const MachineInstr &MI) const
bool mayBeCurLoad(const MachineInstr &MI) const
MachineInstr * CreateMachineInstr(const MCInstrDesc &MCID, DebugLoc DL, bool NoImplicit=false)
CreateMachineInstr - Allocate a new MachineInstr.
void deleteMachineInstr(MachineInstr *MI)
DeleteMachineInstr - Delete the given MachineInstr.
Representation of each machine instruction.
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Register getReg() const
getReg - Returns the register number.
Scheduling unit. This is a node in the scheduling DAG.
bool isInstr() const
Returns true if this SUnit refers to a machine instruction as opposed to an SDNode.
SmallVector< SDep, 4 > Succs
All sunit successors.
MachineInstr * getInstr() const
Returns the representative MachineInstr for this SUnit.
bool contains(const T &V) const
Check if the SmallSet contains the given element.
std::pair< const_iterator, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.