diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-10-06 06:27:31 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-10-06 06:27:31 +0000 |
commit | 49d4c0bd18bd8a220a1dbbb34ea19722458be1db (patch) | |
tree | b925911ba668bc7af846a297042e420c11d779bc /llvm/lib/CodeGen/SelectionDAG | |
parent | cd8fe46d4b22fe7f7847a748d2d59c19147218db (diff) | |
download | bcm5719-llvm-49d4c0bd18bd8a220a1dbbb34ea19722458be1db.tar.gz bcm5719-llvm-49d4c0bd18bd8a220a1dbbb34ea19722458be1db.zip |
- Add TargetInstrInfo::getOperandLatency() to compute operand latencies. This
allow target to correctly compute latency for cases where static scheduling
itineraries isn't sufficient. e.g. variable_ops instructions such as
ARM::ldm.
This also allows target without scheduling itineraries to compute operand
latencies. e.g. X86 can return (approximated) latencies for high latency
instructions such as division.
- Compute operand latencies for those defined by load multiple instructions,
e.g. ldm and those used by store multiple instructions, e.g. stm.
llvm-svn: 115755
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp index 23ff9c5807c..0ffb4da0f36 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp @@ -450,29 +450,11 @@ void ScheduleDAGSDNodes::ComputeOperandLatency(SDNode *Def, SDNode *Use, if (ForceUnitLatencies()) return; - if (!InstrItins || InstrItins->isEmpty()) - return; - if (dep.getKind() != SDep::Data) return; unsigned DefIdx = Use->getOperand(OpIdx).getResNo(); - if (!Def->isMachineOpcode()) - return; - - const TargetInstrDesc &II = TII->get(Def->getMachineOpcode()); - if (DefIdx >= II.getNumDefs()) - return; - - int Latency = 0; - if (!Use->isMachineOpcode()) { - Latency = InstrItins->getOperandCycle(II.getSchedClass(), DefIdx); - } else { - unsigned DefClass = II.getSchedClass(); - unsigned UseClass = TII->get(Use->getMachineOpcode()).getSchedClass(); - Latency = InstrItins->getOperandLatency(DefClass, DefIdx, UseClass, OpIdx); - } - + int Latency = TII->getOperandLatency(InstrItins, Def, DefIdx, Use, OpIdx); if (Latency >= 0) dep.setLatency(Latency); } |