summaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetInstrInfoImpl.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-09-17 23:00:42 +0000
committerAndrew Trick <atrick@apple.com>2012-09-17 23:00:42 +0000
commite1b53287179b4b9b5c3c549586f688d3fa2ae8ef (patch)
tree3d76841b29da81f048e4a8da6149d48575efb2d8 /lib/CodeGen/TargetInstrInfoImpl.cpp
parent419e5b9d4f8bd0e0724b7b2c2d8df0f534bc8d8d (diff)
downloadllvm-e1b53287179b4b9b5c3c549586f688d3fa2ae8ef.tar.gz
llvm-e1b53287179b4b9b5c3c549586f688d3fa2ae8ef.tar.bz2
llvm-e1b53287179b4b9b5c3c549586f688d3fa2ae8ef.tar.xz
Revert r164061-r164067. Most of the new subtarget emitter.
I have to work out the Target/CodeGen header dependencies before putting this back. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetInstrInfoImpl.cpp')
-rw-r--r--lib/CodeGen/TargetInstrInfoImpl.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/CodeGen/TargetInstrInfoImpl.cpp b/lib/CodeGen/TargetInstrInfoImpl.cpp
index 8ed66f7044..7e7f835040 100644
--- a/lib/CodeGen/TargetInstrInfoImpl.cpp
+++ b/lib/CodeGen/TargetInstrInfoImpl.cpp
@@ -606,13 +606,13 @@ getOperandLatency(const InstrItineraryData *ItinData,
/// If we can determine the operand latency from the def only, without itinerary
/// lookup, do so. Otherwise return -1.
-int TargetInstrInfo::computeDefOperandLatency(
- const InstrItineraryData *ItinData,
- const MachineInstr *DefMI, bool FindMin) const {
+static int computeDefOperandLatency(
+ const TargetInstrInfo *TII, const InstrItineraryData *ItinData,
+ const MachineInstr *DefMI, bool FindMin) {
// Let the target hook getInstrLatency handle missing itineraries.
if (!ItinData)
- return getInstrLatency(ItinData, DefMI);
+ return TII->getInstrLatency(ItinData, DefMI);
// Return a latency based on the itinerary properties and defining instruction
// if possible. Some common subtargets don't require per-operand latency,
@@ -621,7 +621,7 @@ int TargetInstrInfo::computeDefOperandLatency(
// If MinLatency is valid, call getInstrLatency. This uses Stage latency if
// it exists before defaulting to MinLatency.
if (ItinData->SchedModel->MinLatency >= 0)
- return getInstrLatency(ItinData, DefMI);
+ return TII->getInstrLatency(ItinData, DefMI);
// If MinLatency is invalid, OperandLatency is interpreted as MinLatency.
// For empty itineraries, short-cirtuit the check and default to one cycle.
@@ -629,7 +629,7 @@ int TargetInstrInfo::computeDefOperandLatency(
return 1;
}
else if(ItinData->isEmpty())
- return defaultDefLatency(ItinData->SchedModel, DefMI);
+ return TII->defaultDefLatency(ItinData->SchedModel, DefMI);
// ...operand lookup required
return -1;
@@ -652,7 +652,7 @@ computeOperandLatency(const InstrItineraryData *ItinData,
const MachineInstr *UseMI, unsigned UseIdx,
bool FindMin) const {
- int DefLatency = computeDefOperandLatency(ItinData, DefMI, FindMin);
+ int DefLatency = computeDefOperandLatency(this, ItinData, DefMI, FindMin);
if (DefLatency >= 0)
return DefLatency;