diff options
author | Andrew Trick <atrick@apple.com> | 2012-10-10 05:43:09 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-10-10 05:43:09 +0000 |
commit | 412cd2f81374865dfa708bef6d5b896ca10dece0 (patch) | |
tree | b31990739e14173a9c6ba0bd63b07a5473fc4c3a /include/llvm/CodeGen/TargetSchedule.h | |
parent | 6312cb099734263f348f36a31b8892b1373a7076 (diff) | |
download | llvm-412cd2f81374865dfa708bef6d5b896ca10dece0.tar.gz llvm-412cd2f81374865dfa708bef6d5b896ca10dece0.tar.bz2 llvm-412cd2f81374865dfa708bef6d5b896ca10dece0.tar.xz |
misched: Use the TargetSchedModel interface wherever possible.
Allows the new machine model to be used for NumMicroOps and OutputLatency.
Allows the HazardRecognizer to be disabled along with itineraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165603 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/TargetSchedule.h')
-rw-r--r-- | include/llvm/CodeGen/TargetSchedule.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/TargetSchedule.h b/include/llvm/CodeGen/TargetSchedule.h index 3adbe7d0d7..3c55f1cbc5 100644 --- a/include/llvm/CodeGen/TargetSchedule.h +++ b/include/llvm/CodeGen/TargetSchedule.h @@ -55,12 +55,29 @@ public: /// latency properties, but separate from the per-cycle itinerary data. bool hasInstrSchedModel() const; + const MCSchedModel *getMCSchedModel() const { return &SchedModel; } + /// \brief Return true if this machine model includes cycle-to-cycle itinerary /// data. /// /// This models scheduling at each stage in the processor pipeline. bool hasInstrItineraries() const; + const InstrItineraryData *getInstrItineraries() const { + if (hasInstrItineraries()) + return &InstrItins; + return 0; + } + + /// \brief Identify the processor corresponding to the current subtarget. + unsigned getProcessorID() const { return SchedModel.getProcessorID(); } + + /// \brief Maximum number of micro-ops that may be scheduled per cycle. + unsigned getIssueWidth() const { return SchedModel.IssueWidth; } + + /// \brief Return the number of issue slots required for this MI. + unsigned getNumMicroOps(MachineInstr *MI) const; + /// \brief Compute operand latency based on the available machine model. /// /// Computes and return the latency of the given data dependent def and use @@ -82,11 +99,12 @@ public: /// occasionally useful to help estimate instruction cost. unsigned computeInstrLatency(const MachineInstr *MI) const; - /// \brief Identify the processor corresponding to the current subtarget. - unsigned getProcessorID() const { return SchedModel.getProcessorID(); } + /// \brief Output dependency latency of a pair of defs of the same register. + /// + /// This is typically one cycle. + unsigned computeOutputLatency(const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *DepMI) const; - /// \brief Maximum number of micro-ops that may be scheduled per cycle. - unsigned getIssueWidth() const { return SchedModel.IssueWidth; } private: /// getDefLatency is a helper for computeOperandLatency. Return the |