[llvm-commits] [llvm] r161470 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/TargetInstrInfoImpl.cpp
Andrew Trick
atrick at apple.com
Tue Aug 7 19:44:11 PDT 2012
Author: atrick
Date: Tue Aug 7 21:44:11 2012
New Revision: 161470
URL: http://llvm.org/viewvc/llvm-project?rev=161470&view=rev
Log:
Minor cleanup of defaultDefLatency API
Modified:
llvm/trunk/include/llvm/Target/TargetInstrInfo.h
llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp
Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=161470&r1=161469&r2=161470&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Tue Aug 7 21:44:11 2012
@@ -28,6 +28,7 @@
class MachineRegisterInfo;
class MDNode;
class MCInst;
+class MCSchedModel;
class SDNode;
class ScheduleHazardRecognizer;
class SelectionDAG;
@@ -790,7 +791,7 @@
SDNode *Node) const = 0;
/// Return the default expected latency for a def based on it's opcode.
- unsigned defaultDefLatency(const InstrItineraryData *ItinData,
+ unsigned defaultDefLatency(const MCSchedModel *SchedModel,
const MachineInstr *DefMI) const;
/// isHighLatencyDef - Return true if this opcode has high latency to its
Modified: llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp?rev=161470&r1=161469&r2=161470&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Tue Aug 7 21:44:11 2012
@@ -570,12 +570,12 @@
}
/// Return the default expected latency for a def based on it's opcode.
-unsigned TargetInstrInfo::defaultDefLatency(const InstrItineraryData *ItinData,
+unsigned TargetInstrInfo::defaultDefLatency(const MCSchedModel *SchedModel,
const MachineInstr *DefMI) const {
if (DefMI->mayLoad())
- return ItinData->SchedModel->LoadLatency;
+ return SchedModel->LoadLatency;
if (isHighLatencyDef(DefMI->getOpcode()))
- return ItinData->SchedModel->HighLatency;
+ return SchedModel->HighLatency;
return 1;
}
@@ -638,7 +638,7 @@
return 1;
}
else if(ItinData->isEmpty())
- return TII->defaultDefLatency(ItinData, DefMI);
+ return TII->defaultDefLatency(ItinData->SchedModel, DefMI);
// ...operand lookup required
return -1;
@@ -669,7 +669,8 @@
// Expected latency is the max of the stage latency and itinerary props.
if (!FindMin)
- InstrLatency = std::max(InstrLatency, defaultDefLatency(ItinData, DefMI));
+ InstrLatency = std::max(InstrLatency,
+ defaultDefLatency(ItinData->SchedModel, DefMI));
return InstrLatency;
}
@@ -742,6 +743,7 @@
// Expected latency is the max of the stage latency and itinerary props.
if (!FindMin)
- InstrLatency = std::max(InstrLatency, defaultDefLatency(ItinData, DefMI));
+ InstrLatency = std::max(InstrLatency,
+ defaultDefLatency(ItinData->SchedModel, DefMI));
return InstrLatency;
}
More information about the llvm-commits
mailing list