26 #define DEBUG_TYPE "post-RA-sched" 35 PrefVectorStoreNew =
nullptr;
42 if (!MI || TII->isZeroCost(MI->
getOpcode()))
46 LLVM_DEBUG(
dbgs() <<
"*** Hazard in cycle " << PacketNum <<
", " << *MI);
69 if (SU == UsesDotCur && DotCurPNum != (
int)PacketNum) {
70 LLVM_DEBUG(
dbgs() <<
"*** .cur Hazard in cycle " << PacketNum <<
", " 81 if (DotCurPNum != -1 && DotCurPNum != (
int)PacketNum) {
86 PrefVectorStoreNew =
nullptr;
102 if (PrefVectorStoreNew !=
nullptr && PrefVectorStoreNew != SU)
106 return UsesDotCur && ((SU == UsesDotCur) ^ (DotCurPNum == (
int)PacketNum));
117 if (MO.isReg() && MO.isDef() && !MO.isImplicit())
118 RegDefs.
insert(MO.getReg());
129 MF->CreateMachineInstr(TII->get(TII->
getDotNewOp(*MI)),
133 MF->DeleteMachineInstr(NewMI);
144 for (
auto &S : SU->
Succs)
145 if (S.isAssignedRegDep() && S.getLatency() == 0 &&
146 S.getSUnit()->NumPredsLeft == 1) {
147 UsesDotCur = S.getSUnit();
148 DotCurPNum = PacketNum;
151 if (SU == UsesDotCur) {
152 UsesDotCur =
nullptr;
159 for (
auto &S : SU->
Succs)
160 if (S.isAssignedRegDep() && S.getLatency() == 0 &&
163 PrefVectorStoreNew = S.getSUnit();
bool ShouldPreferAnother(SUnit *) override
This callback may be invoked if getHazardType returns NoHazard.
This class represents lattice values for constants.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
unsigned getReg() const
getReg - Returns the register number.
iterator_range< mop_iterator > operands()
MachineInstr * CreateMachineInstr(const MCInstrDesc &MCID, const DebugLoc &DL, bool NoImp=false)
CreateMachineInstr - Allocate a new MachineInstr.
void EmitInstruction(SUnit *) override
This callback is invoked when an instruction is emitted to be scheduled, to advance the hazard state...
bool isHVXVec(const MachineInstr &MI) const
void AdvanceCycle() override
This callback is invoked whenever the next top-down instruction to be scheduled cannot issue in the c...
unsigned getNumOperands() const
Retuns the total number of operands.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
HazardType getHazardType(SUnit *SU, int stalls) override
Return the hazard type of emitting this node.
void Reset() override
This callback is invoked when a new block of instructions is about to be scheduled.
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
MachineInstr * getInstr() const
Returns the representative MachineInstr for this SUnit.
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
void DeleteMachineInstr(MachineInstr *MI)
DeleteMachineInstr - Delete the given MachineInstr.
MachineOperand class - Representation of each machine instruction operand.
bool canReserveResources(const MCInstrDesc *MID)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
int getDotNewOp(const MachineInstr &MI) const
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
bool mayBeNewStore(const MachineInstr &MI) const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SmallVector< SDep, 4 > Succs
All sunit successors.
bool mayBeCurLoad(const MachineInstr &MI) const
const MachineOperand & getOperand(unsigned i) const
bool isInstr() const
Returns true if this SUnit refers to a machine instruction as opposed to an SDNode.
Scheduling unit. This is a node in the scheduling DAG.
void reserveResources(const MCInstrDesc *MID)
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.