14 #define DEBUG_TYPE "pre-RA-sched"
79 void PPCHazardRecognizer970::EndDispatchGroup() {
80 DEBUG(
errs() <<
"=== Start of dispatch group\n");
90 PPCHazardRecognizer970::GetInstrType(
unsigned Opcode,
91 bool &isFirst,
bool &isSingle,
93 bool &isLoad,
bool &isStore) {
99 uint64_t TSFlags = MCID.
TSFlags;
109 bool PPCHazardRecognizer970::
110 isLoadOfStoredAddress(uint64_t LoadSize, int64_t LoadOffset,
111 const Value *LoadValue)
const {
112 for (
unsigned i = 0, e = NumStores; i != e; ++i) {
114 if (LoadValue == StoreValue[i] && LoadOffset == StoreOffset[i])
119 if (StoreValue[i] == LoadValue) {
122 if (StoreOffset[i] < LoadOffset) {
123 if (int64_t(StoreOffset[i]+StoreSize[i]) > LoadOffset)
return true;
125 if (int64_t(LoadOffset+LoadSize) > StoreOffset[i])
return true;
138 assert(Stalls == 0 &&
"PPC hazards don't support scoreboard lookahead");
146 bool isFirst, isSingle, isCracked, isLoad, isStore;
148 GetInstrType(Opcode, isFirst, isSingle, isCracked,
154 if (NumIssued != 0 && (isFirst || isSingle))
160 if (isCracked && NumIssued > 2)
171 if (NumIssued == 4)
return Hazard;
175 if (NumIssued >= 2)
return Hazard;
189 if (isLoadOfStoredAddress(MO->
getSize(),
204 bool isFirst, isSingle, isCracked, isLoad, isStore;
206 GetInstrType(Opcode, isFirst, isSingle, isCracked,
211 if (Opcode ==
PPC::MTCTR || Opcode == PPC::MTCTR8) HasCTRSet =
true;
214 if (isStore && NumStores < 4 && !MI->memoperands_empty()) {
216 StoreSize[NumStores] = MO->
getSize();
217 StoreOffset[NumStores] = MO->
getOffset();
218 StoreValue[NumStores] = MO->
getValue();
236 assert(NumIssued < 5 &&
"Illegal dispatch group!");
virtual void AdvanceCycle()
bool mayStore() const
Return true if this instruction could possibly modify memory. Instructions with this flag set are not...
virtual void AdvanceCycle()
MachineInstr * getInstr() const
virtual HazardType getHazardType(SUnit *SU, int Stalls)
virtual HazardType getHazardType(SUnit *SU, int Stalls)
virtual void EmitInstruction(SUnit *SU)
#define llvm_unreachable(msg)
virtual void AdvanceCycle()
bool isDebugValue() const
virtual HazardType getHazardType(SUnit *SU, int Stalls)
virtual void EmitInstruction(SUnit *SU)
const MCInstrDesc & get(unsigned Opcode) const
virtual const TargetInstrInfo * getInstrInfo() const
bool memoperands_empty() const
virtual void EmitInstruction(SUnit *SU)
bool mayLoad() const
Return true if this instruction could possibly read memory. Instructions with this flag set are not n...
const Value * getValue() const
LLVM Value Representation.
int64_t getOffset() const
uint64_t getSize() const
getSize - Return the size in bytes of the memory reference.
const MCInstrDesc * getInstrDesc(const SUnit *SU) const
PPCHazardRecognizer970(const TargetMachine &TM)
SUnit - Scheduling unit. This is a node in the scheduling DAG.
mmo_iterator memoperands_begin() const
Access to memory operands of the instruction.