diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/ScheduleHazardRecognizer.h | 2 | ||||
-rw-r--r-- | include/llvm/Target/TargetInstrInfo.h | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/ScheduleHazardRecognizer.h b/include/llvm/CodeGen/ScheduleHazardRecognizer.h index 4771a35bc7..2f53baa1c7 100644 --- a/include/llvm/CodeGen/ScheduleHazardRecognizer.h +++ b/include/llvm/CodeGen/ScheduleHazardRecognizer.h @@ -42,6 +42,8 @@ public: unsigned getMaxLookAhead() const { return MaxLookAhead; } + bool isEnabled() const { return MaxLookAhead != 0; } + /// atIssueLimit - Return true if no more instructions may be issued in this /// cycle. virtual bool atIssueLimit() const { return false; } diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index cd22765f76..fc7b51ec6c 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -567,9 +567,9 @@ public: virtual unsigned getInlineAsmLength(const char *Str, const MCAsmInfo &MAI) const; - /// CreateTargetPreRAHazardRecognizer - Allocate and return a hazard - /// recognizer to use for this target when scheduling the machine instructions - /// before register allocation. + /// CreateTargetHazardRecognizer - Allocate and return a hazard recognizer to + /// use for this target when scheduling the machine instructions before + /// register allocation. virtual ScheduleHazardRecognizer* CreateTargetHazardRecognizer(const TargetMachine *TM, const ScheduleDAG *DAG) const = 0; @@ -610,6 +610,14 @@ public: virtual unsigned getNumMicroOps(const InstrItineraryData *ItinData, const MachineInstr *MI) const; + /// isZeroCost - Return true for pseudo instructions that don't consume any + /// machine resources in their current form. These are common cases that the + /// scheduler should consider free, rather than conservatively handling them + /// as instructions with no itinerary. + bool isZeroCost(unsigned Opcode) const { + return Opcode <= TargetOpcode::COPY; + } + /// getOperandLatency - Compute and return the use operand latency of a given /// pair of def and use. /// In most cases, the static scheduling itinerary was enough to determine the @@ -686,6 +694,8 @@ public: const MachineBasicBlock *MBB, const MachineFunction &MF) const; + bool usePreRAHazardRecognizer() const; + virtual ScheduleHazardRecognizer * CreateTargetHazardRecognizer(const TargetMachine*, const ScheduleDAG*) const; |