summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/TargetSchedule.h
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-09-14 20:26:46 +0000
committerAndrew Trick <atrick@apple.com>2012-09-14 20:26:46 +0000
commit99ab6c6035aec3c0e9b0cc5b76a4666fc5fd7b7b (patch)
tree61b4450cacacf4c8c86fac236218ded5f54871bd /include/llvm/CodeGen/TargetSchedule.h
parent72d048b69705f01d48bdef7b235ec96b24290767 (diff)
downloadllvm-99ab6c6035aec3c0e9b0cc5b76a4666fc5fd7b7b.tar.gz
llvm-99ab6c6035aec3c0e9b0cc5b76a4666fc5fd7b7b.tar.bz2
llvm-99ab6c6035aec3c0e9b0cc5b76a4666fc5fd7b7b.tar.xz
TargetSchedModel interface. To be implemented...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/TargetSchedule.h')
-rw-r--r--include/llvm/CodeGen/TargetSchedule.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/TargetSchedule.h b/include/llvm/CodeGen/TargetSchedule.h
new file mode 100644
index 0000000000..4cf6f778a6
--- /dev/null
+++ b/include/llvm/CodeGen/TargetSchedule.h
@@ -0,0 +1,63 @@
+//===-- llvm/CodeGen/TargetSchedule.h - Sched Machine Model -----*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines a wrapper around MCSchedModel that allows the interface to
+// benefit from information currently only available in TargetInstrInfo.
+// Ideally, the scheduling interface would be fully defined in the MC layter.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TARGET_TARGETSCHEDMODEL_H
+#define LLVM_TARGET_TARGETSCHEDMODEL_H
+
+#include "llvm/MC/MCSchedule.h"
+#include "llvm/MC/MCInstrItineraries.h"
+
+namespace llvm {
+
+class TargetRegisterInfo;
+class TargetSubtargetInfo;
+class TargetInstrInfo;
+class MachineInstr;
+
+/// Provide an instruction scheduling machine model to CodeGen passes.
+class TargetSchedModel {
+ // For efficiency, hold a copy of the statically defined MCSchedModel for this
+ // processor.
+ MCSchedModel SchedModel;
+ InstrItineraryData InstrItins;
+ const TargetSubtargetInfo *STI;
+ const TargetInstrInfo *TII;
+public:
+ TargetSchedModel(): STI(0), TII(0) {}
+
+ void init(const MCSchedModel &sm, const TargetSubtargetInfo *sti,
+ const TargetInstrInfo *tii);
+
+ const TargetInstrInfo *getInstrInfo() const { return TII; }
+
+ /// Return true if this machine model includes an instruction-level scheduling
+ /// model. This is more detailed than the course grain IssueWidth and default
+ /// latency properties, but separate from the per-cycle itinerary data.
+ bool hasInstrSchedModel() const {
+ return SchedModel.hasInstrSchedModel();
+ }
+
+ /// 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 {
+ return SchedModel.hasInstrItineraries();
+ }
+
+ unsigned getProcessorID() const { return SchedModel.getProcessorID(); }
+};
+
+} // namespace llvm
+
+#endif