aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Target/TargetSubtargetInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Target/TargetSubtargetInfo.h')
-rw-r--r--include/llvm/Target/TargetSubtargetInfo.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetSubtargetInfo.h b/include/llvm/Target/TargetSubtargetInfo.h
index 8c6c695b19..bc357ac529 100644
--- a/include/llvm/Target/TargetSubtargetInfo.h
+++ b/include/llvm/Target/TargetSubtargetInfo.h
@@ -14,6 +14,7 @@
#ifndef LLVM_TARGET_TARGETSUBTARGETINFO_H
#define LLVM_TARGET_TARGETSUBTARGETINFO_H
+#include "llvm/Codegen/TargetSchedule.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/CodeGen.h"
@@ -43,6 +44,15 @@ public:
virtual ~TargetSubtargetInfo();
+ /// Initialize a copy of the scheduling model for this subtarget.
+ /// TargetSchedModel provides the interface for the subtarget's
+ /// instruction scheduling information.
+ void initSchedModel(TargetSchedModel &SchedModel,
+ const TargetInstrInfo *TII) const {
+ // CPUSchedModel is initialized to a static instance by InitMCSubtargetInfo.
+ SchedModel.init(*getSchedModel(), this, TII);
+ }
+
/// getSpecialAddressLatency - For targets where it is beneficial to
/// backschedule instructions that compute addresses, return a value
/// indicating the number of scheduling cycles of backscheduling that