diff options
author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-03-13 15:22:13 +0000 |
---|---|---|
committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-03-13 15:22:13 +0000 |
commit | 30c1ba4834a9666ef5536a35c445cd8e91fcd0f5 (patch) | |
tree | 275508c1c5ca028ca1addf748b2d9b296745bb48 /llvm/lib/CodeGen/TargetSchedule.cpp | |
parent | 8150810556479b04e00578c9d7d4c30814898694 (diff) | |
download | bcm5719-llvm-30c1ba4834a9666ef5536a35c445cd8e91fcd0f5.tar.gz bcm5719-llvm-30c1ba4834a9666ef5536a35c445cd8e91fcd0f5.zip |
[MC] Move the instruction latency computation from TargetSchedModel to MCSchedModel.
The goal is to make the latency information accessible through the MCSchedModel
interface. This is particularly important for tools like llvm-mca that only have
access to the MCSchedModel API.
This partially fixes PR36676.
No functional change intended.
Differential Revision: https://reviews.llvm.org/D44383
llvm-svn: 327406
Diffstat (limited to 'llvm/lib/CodeGen/TargetSchedule.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetSchedule.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/TargetSchedule.cpp b/llvm/lib/CodeGen/TargetSchedule.cpp index 7d636b126e0..432545bde1f 100644 --- a/llvm/lib/CodeGen/TargetSchedule.cpp +++ b/llvm/lib/CodeGen/TargetSchedule.cpp @@ -257,15 +257,7 @@ unsigned TargetSchedModel::computeOperandLatency( unsigned TargetSchedModel::computeInstrLatency(const MCSchedClassDesc &SCDesc) const { - unsigned Latency = 0; - for (unsigned DefIdx = 0, DefEnd = SCDesc.NumWriteLatencyEntries; - DefIdx != DefEnd; ++DefIdx) { - // Lookup the definition's write latency in SubtargetInfo. - const MCWriteLatencyEntry *WLEntry = - STI->getWriteLatencyEntry(&SCDesc, DefIdx); - Latency = std::max(Latency, capLatency(WLEntry->Cycles)); - } - return Latency; + return capLatency(MCSchedModel::computeInstrLatency(*STI, SCDesc)); } unsigned TargetSchedModel::computeInstrLatency(unsigned Opcode) const { |