summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-08-08 02:44:16 +0000
committerAndrew Trick <atrick@apple.com>2012-08-08 02:44:16 +0000
commitd43b5c97cff06d7840b974ca84fa0639d2567968 (patch)
treeeb9de873f2da7cc46629dc7c007658844382a9e8 /include
parent3c417554caedde3a333755916701c8380606342a (diff)
downloadllvm-d43b5c97cff06d7840b974ca84fa0639d2567968.tar.gz
llvm-d43b5c97cff06d7840b974ca84fa0639d2567968.tar.bz2
llvm-d43b5c97cff06d7840b974ca84fa0639d2567968.tar.xz
Added MispredictPenalty to SchedMachineModel.
This replaces an existing subtarget hook on ARM and allows standard CodeGen passes to potentially use the property. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161471 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCSchedule.h10
-rw-r--r--include/llvm/Target/TargetSchedule.td1
2 files changed, 9 insertions, 2 deletions
diff --git a/include/llvm/MC/MCSchedule.h b/include/llvm/MC/MCSchedule.h
index 626accb86b..3b1cdf1cd2 100644
--- a/include/llvm/MC/MCSchedule.h
+++ b/include/llvm/MC/MCSchedule.h
@@ -78,6 +78,11 @@ public:
unsigned HighLatency;
static const unsigned DefaultHighLatency = 10;
+ // MispredictPenalty is the typical number of extra cycles the processor
+ // takes to recover from a branch misprediction.
+ unsigned MispredictPenalty;
+ static const unsigned DefaultMispredictPenalty = 10;
+
private:
// TODO: Add a reference to proc resource types and sched resource tables.
@@ -94,13 +99,14 @@ public:
MinLatency(DefaultMinLatency),
LoadLatency(DefaultLoadLatency),
HighLatency(DefaultHighLatency),
+ MispredictPenalty(DefaultMispredictPenalty),
InstrItineraries(0) {}
// Table-gen driven ctor.
- MCSchedModel(unsigned iw, int ml, unsigned ll, unsigned hl,
+ MCSchedModel(unsigned iw, int ml, unsigned ll, unsigned hl, unsigned mp,
const InstrItinerary *ii):
IssueWidth(iw), MinLatency(ml), LoadLatency(ll), HighLatency(hl),
- InstrItineraries(ii){}
+ MispredictPenalty(mp), InstrItineraries(ii){}
};
} // End llvm namespace
diff --git a/include/llvm/Target/TargetSchedule.td b/include/llvm/Target/TargetSchedule.td
index 5bbed58c87..4dc488dbae 100644
--- a/include/llvm/Target/TargetSchedule.td
+++ b/include/llvm/Target/TargetSchedule.td
@@ -27,6 +27,7 @@ class SchedMachineModel {
// (-1) inorder (0) ooo, (1): inorder +var latencies.
int LoadLatency = -1; // Cycles for loads to access the cache.
int HighLatency = -1; // Approximation of cycles for "high latency" ops.
+ int MispredictPenalty = -1; // Extra cycles for a mispredicted branch.
ProcessorItineraries Itineraries = NoItineraries;