blob: 195279719ad47c06febfea864722e6826211a397 [file] [log] [blame]
Eugene Zelenkofa912a72017-02-27 22:45:06 +00001//===- llvm/Target/TargetSchedule.cpp - Sched Machine Model ---------------===//
Andrew Trickd2a19da2012-09-14 20:26:46 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Andrew Trickd2a19da2012-09-14 20:26:46 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file implements a wrapper around MCSchedModel that allows the interface
10// to benefit from information currently only available in TargetInstrInfo.
11//
12//===----------------------------------------------------------------------===//
13
Chandler Carruth6bda14b2017-06-06 11:49:48 +000014#include "llvm/CodeGen/TargetSchedule.h"
Eugene Zelenkofa912a72017-02-27 22:45:06 +000015#include "llvm/CodeGen/MachineFunction.h"
16#include "llvm/CodeGen/MachineInstr.h"
17#include "llvm/CodeGen/MachineOperand.h"
David Blaikie3f833ed2017-11-08 01:01:31 +000018#include "llvm/CodeGen/TargetInstrInfo.h"
David Blaikieb3bde2e2017-11-17 01:07:10 +000019#include "llvm/CodeGen/TargetRegisterInfo.h"
20#include "llvm/CodeGen/TargetSubtargetInfo.h"
Eugene Zelenkofa912a72017-02-27 22:45:06 +000021#include "llvm/MC/MCInstrDesc.h"
22#include "llvm/MC/MCInstrItineraries.h"
23#include "llvm/MC/MCSchedule.h"
Chandler Carruthed0881b2012-12-03 16:50:05 +000024#include "llvm/Support/CommandLine.h"
Eugene Zelenkofa912a72017-02-27 22:45:06 +000025#include "llvm/Support/ErrorHandling.h"
Chandler Carruthed0881b2012-12-03 16:50:05 +000026#include "llvm/Support/raw_ostream.h"
Eugene Zelenkofa912a72017-02-27 22:45:06 +000027#include <algorithm>
28#include <cassert>
29#include <cstdint>
Andrew Trickd2a19da2012-09-14 20:26:46 +000030
31using namespace llvm;
32
Andrew Trick8abcf4d2012-10-04 00:24:34 +000033static cl::opt<bool> EnableSchedModel("schedmodel", cl::Hidden, cl::init(true),
Andrew Trickd2a19da2012-09-14 20:26:46 +000034 cl::desc("Use TargetSchedModel for latency lookup"));
35
Andrew Trick6e6d5972012-09-18 04:03:34 +000036static cl::opt<bool> EnableSchedItins("scheditins", cl::Hidden, cl::init(true),
37 cl::desc("Use InstrItineraryData for latency lookup"));
38
Andrew Trickcfcf5202012-10-09 23:44:26 +000039bool TargetSchedModel::hasInstrSchedModel() const {
40 return EnableSchedModel && SchedModel.hasInstrSchedModel();
41}
42
43bool TargetSchedModel::hasInstrItineraries() const {
44 return EnableSchedItins && !InstrItins.isEmpty();
45}
46
Andrew Tricke96390e2012-11-06 07:10:38 +000047static unsigned gcd(unsigned Dividend, unsigned Divisor) {
48 // Dividend and Divisor will be naturally swapped as needed.
Eugene Zelenkofa912a72017-02-27 22:45:06 +000049 while (Divisor) {
Andrew Tricke96390e2012-11-06 07:10:38 +000050 unsigned Rem = Dividend % Divisor;
51 Dividend = Divisor;
52 Divisor = Rem;
53 };
54 return Dividend;
55}
Eugene Zelenkofa912a72017-02-27 22:45:06 +000056
Andrew Tricke96390e2012-11-06 07:10:38 +000057static unsigned lcm(unsigned A, unsigned B) {
58 unsigned LCM = (uint64_t(A) * B) / gcd(A, B);
59 assert((LCM >= A && LCM >= B) && "LCM overflow");
60 return LCM;
61}
62
Sanjay Patel0d7df362018-04-08 19:56:04 +000063void TargetSchedModel::init(const TargetSubtargetInfo *TSInfo) {
64 STI = TSInfo;
65 SchedModel = TSInfo->getSchedModel();
66 TII = TSInfo->getInstrInfo();
Andrew Trickd2a19da2012-09-14 20:26:46 +000067 STI->initInstrItins(InstrItins);
Andrew Tricke96390e2012-11-06 07:10:38 +000068
69 unsigned NumRes = SchedModel.getNumProcResourceKinds();
70 ResourceFactors.resize(NumRes);
71 ResourceLCM = SchedModel.IssueWidth;
72 for (unsigned Idx = 0; Idx < NumRes; ++Idx) {
73 unsigned NumUnits = SchedModel.getProcResource(Idx)->NumUnits;
74 if (NumUnits > 0)
75 ResourceLCM = lcm(ResourceLCM, NumUnits);
76 }
77 MicroOpFactor = ResourceLCM / SchedModel.IssueWidth;
78 for (unsigned Idx = 0; Idx < NumRes; ++Idx) {
79 unsigned NumUnits = SchedModel.getProcResource(Idx)->NumUnits;
80 ResourceFactors[Idx] = NumUnits ? (ResourceLCM / NumUnits) : 0;
81 }
Andrew Trickd2a19da2012-09-14 20:26:46 +000082}
Andrew Trick6e6d5972012-09-18 04:03:34 +000083
Javed Absar3d594372017-03-27 20:46:37 +000084/// Returns true only if instruction is specified as single issue.
85bool TargetSchedModel::mustBeginGroup(const MachineInstr *MI,
86 const MCSchedClassDesc *SC) const {
87 if (hasInstrSchedModel()) {
88 if (!SC)
89 SC = resolveSchedClass(MI);
90 if (SC->isValid())
91 return SC->BeginGroup;
92 }
93 return false;
94}
95
96bool TargetSchedModel::mustEndGroup(const MachineInstr *MI,
97 const MCSchedClassDesc *SC) const {
98 if (hasInstrSchedModel()) {
99 if (!SC)
100 SC = resolveSchedClass(MI);
101 if (SC->isValid())
102 return SC->EndGroup;
103 }
104 return false;
105}
106
Andrew Tricke96390e2012-11-06 07:10:38 +0000107unsigned TargetSchedModel::getNumMicroOps(const MachineInstr *MI,
108 const MCSchedClassDesc *SC) const {
Andrew Trickdd79f0f2012-10-10 05:43:09 +0000109 if (hasInstrItineraries()) {
110 int UOps = InstrItins.getNumMicroOps(MI->getDesc().getSchedClass());
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000111 return (UOps >= 0) ? UOps : TII->getNumMicroOps(&InstrItins, *MI);
Andrew Trickdd79f0f2012-10-10 05:43:09 +0000112 }
Andrew Trick5f35afb2012-10-11 05:37:06 +0000113 if (hasInstrSchedModel()) {
Andrew Tricke96390e2012-11-06 07:10:38 +0000114 if (!SC)
115 SC = resolveSchedClass(MI);
116 if (SC->isValid())
117 return SC->NumMicroOps;
Andrew Trick5f35afb2012-10-11 05:37:06 +0000118 }
119 return MI->isTransient() ? 0 : 1;
Andrew Trickdd79f0f2012-10-10 05:43:09 +0000120}
121
Andrew Trick0b1d8d02012-10-17 17:27:10 +0000122// The machine model may explicitly specify an invalid latency, which
123// effectively means infinite latency. Since users of the TargetSchedule API
124// don't know how to handle this, we convert it to a very large latency that is
125// easy to distinguish when debugging the DAG but won't induce overflow.
Andrew Trickde2109e2013-06-15 04:49:57 +0000126static unsigned capLatency(int Cycles) {
Andrew Trick0b1d8d02012-10-17 17:27:10 +0000127 return Cycles >= 0 ? Cycles : 1000;
128}
129
Andrew Trick6e6d5972012-09-18 04:03:34 +0000130/// Return the MCSchedClassDesc for this instruction. Some SchedClasses require
131/// evaluation of predicates that depend on instruction operands or flags.
132const MCSchedClassDesc *TargetSchedModel::
133resolveSchedClass(const MachineInstr *MI) const {
Andrew Trick6e6d5972012-09-18 04:03:34 +0000134 // Get the definition's scheduling class descriptor from this machine model.
135 unsigned SchedClass = MI->getDesc().getSchedClass();
136 const MCSchedClassDesc *SCDesc = SchedModel.getSchedClassDesc(SchedClass);
Andrew Trickbe2bccb2013-04-13 06:07:45 +0000137 if (!SCDesc->isValid())
138 return SCDesc;
Andrew Trick6e6d5972012-09-18 04:03:34 +0000139
140#ifndef NDEBUG
141 unsigned NIter = 0;
142#endif
143 while (SCDesc->isVariant()) {
144 assert(++NIter < 6 && "Variants are nested deeper than the magic number");
145
146 SchedClass = STI->resolveSchedClass(SchedClass, MI, this);
147 SCDesc = SchedModel.getSchedClassDesc(SchedClass);
148 }
149 return SCDesc;
150}
151
152/// Find the def index of this operand. This index maps to the machine model and
153/// is independent of use operands. Def operands may be reordered with uses or
154/// merged with uses without affecting the def index (e.g. before/after
155/// regalloc). However, an instruction's def operands must never be reordered
156/// with respect to each other.
157static unsigned findDefIdx(const MachineInstr *MI, unsigned DefOperIdx) {
158 unsigned DefIdx = 0;
159 for (unsigned i = 0; i != DefOperIdx; ++i) {
160 const MachineOperand &MO = MI->getOperand(i);
161 if (MO.isReg() && MO.isDef())
162 ++DefIdx;
163 }
164 return DefIdx;
165}
166
167/// Find the use index of this operand. This is independent of the instruction's
168/// def operands.
Andrew Trickf2b70d92012-09-18 18:20:02 +0000169///
170/// Note that uses are not determined by the operand's isUse property, which
171/// is simply the inverse of isDef. Here we consider any readsReg operand to be
172/// a "use". The machine model allows an operand to be both a Def and Use.
Andrew Trick6e6d5972012-09-18 04:03:34 +0000173static unsigned findUseIdx(const MachineInstr *MI, unsigned UseOperIdx) {
174 unsigned UseIdx = 0;
175 for (unsigned i = 0; i != UseOperIdx; ++i) {
176 const MachineOperand &MO = MI->getOperand(i);
Matthias Braun3a133152016-08-24 02:32:29 +0000177 if (MO.isReg() && MO.readsReg() && !MO.isDef())
Andrew Trick6e6d5972012-09-18 04:03:34 +0000178 ++UseIdx;
179 }
180 return UseIdx;
181}
182
183// Top-level API for clients that know the operand indices.
184unsigned TargetSchedModel::computeOperandLatency(
185 const MachineInstr *DefMI, unsigned DefOperIdx,
Andrew Trickde2109e2013-06-15 04:49:57 +0000186 const MachineInstr *UseMI, unsigned UseOperIdx) const {
Andrew Trick6e6d5972012-09-18 04:03:34 +0000187
Andrew Trickde2109e2013-06-15 04:49:57 +0000188 if (!hasInstrSchedModel() && !hasInstrItineraries())
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000189 return TII->defaultDefLatency(SchedModel, *DefMI);
Andrew Trick6e6d5972012-09-18 04:03:34 +0000190
Andrew Trickcfcf5202012-10-09 23:44:26 +0000191 if (hasInstrItineraries()) {
Andrew Trick8abcf4d2012-10-04 00:24:34 +0000192 int OperLatency = 0;
193 if (UseMI) {
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000194 OperLatency = TII->getOperandLatency(&InstrItins, *DefMI, DefOperIdx,
195 *UseMI, UseOperIdx);
Andrew Trick6e6d5972012-09-18 04:03:34 +0000196 }
Andrew Trick8abcf4d2012-10-04 00:24:34 +0000197 else {
198 unsigned DefClass = DefMI->getDesc().getSchedClass();
199 OperLatency = InstrItins.getOperandCycle(DefClass, DefOperIdx);
200 }
201 if (OperLatency >= 0)
202 return OperLatency;
203
204 // No operand latency was found.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000205 unsigned InstrLatency = TII->getInstrLatency(&InstrItins, *DefMI);
Andrew Trick8abcf4d2012-10-04 00:24:34 +0000206
207 // Expected latency is the max of the stage latency and itinerary props.
Andrew Trick780fae82012-10-09 23:44:32 +0000208 // Rather than directly querying InstrItins stage latency, we call a TII
209 // hook to allow subtargets to specialize latency. This hook is only
210 // applicable to the InstrItins model. InstrSchedModel should model all
211 // special cases without TII hooks.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000212 InstrLatency =
213 std::max(InstrLatency, TII->defaultDefLatency(SchedModel, *DefMI));
Andrew Trick8abcf4d2012-10-04 00:24:34 +0000214 return InstrLatency;
215 }
Andrew Trickde2109e2013-06-15 04:49:57 +0000216 // hasInstrSchedModel()
Andrew Trick8abcf4d2012-10-04 00:24:34 +0000217 const MCSchedClassDesc *SCDesc = resolveSchedClass(DefMI);
218 unsigned DefIdx = findDefIdx(DefMI, DefOperIdx);
219 if (DefIdx < SCDesc->NumWriteLatencyEntries) {
220 // Lookup the definition's write latency in SubtargetInfo.
221 const MCWriteLatencyEntry *WLEntry =
222 STI->getWriteLatencyEntry(SCDesc, DefIdx);
223 unsigned WriteID = WLEntry->WriteResourceID;
Andrew Trickde2109e2013-06-15 04:49:57 +0000224 unsigned Latency = capLatency(WLEntry->Cycles);
Andrew Trick8abcf4d2012-10-04 00:24:34 +0000225 if (!UseMI)
226 return Latency;
227
228 // Lookup the use's latency adjustment in SubtargetInfo.
229 const MCSchedClassDesc *UseDesc = resolveSchedClass(UseMI);
230 if (UseDesc->NumReadAdvanceEntries == 0)
231 return Latency;
232 unsigned UseIdx = findUseIdx(UseMI, UseOperIdx);
Andrew Trick5d4861862013-06-17 21:45:18 +0000233 int Advance = STI->getReadAdvanceCycles(UseDesc, UseIdx, WriteID);
234 if (Advance > 0 && (unsigned)Advance > Latency) // unsigned wrap
235 return 0;
236 return Latency - Advance;
Andrew Trick8abcf4d2012-10-04 00:24:34 +0000237 }
238 // If DefIdx does not exist in the model (e.g. implicit defs), then return
239 // unit latency (defaultDefLatency may be too conservative).
Andrew Trickf2b70d92012-09-18 18:20:02 +0000240#ifndef NDEBUG
Andrew Trick8abcf4d2012-10-04 00:24:34 +0000241 if (SCDesc->isValid() && !DefMI->getOperand(DefOperIdx).isImplicit()
Andrew Trickb6854d82013-09-25 18:14:12 +0000242 && !DefMI->getDesc().OpInfo[DefOperIdx].isOptionalDef()
243 && SchedModel.isComplete()) {
Matthias Braun244a6772015-07-17 17:50:11 +0000244 errs() << "DefIdx " << DefIdx << " exceeds machine model writes for "
MinSeong Kim4a9a4e12016-01-05 14:50:15 +0000245 << *DefMI << " (Try with MCSchedModel.CompleteModel set to false)";
Matthias Braun244a6772015-07-17 17:50:11 +0000246 llvm_unreachable("incomplete machine model");
Andrew Trick8abcf4d2012-10-04 00:24:34 +0000247 }
Andrew Trickf2b70d92012-09-18 18:20:02 +0000248#endif
Andrew Trick60570172013-03-16 18:58:57 +0000249 // FIXME: Automatically giving all implicit defs defaultDefLatency is
250 // undesirable. We should only do it for defs that are known to the MC
251 // desc like flags. Truly implicit defs should get 1 cycle latency.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000252 return DefMI->isTransient() ? 0 : TII->defaultDefLatency(SchedModel, *DefMI);
Andrew Trick6e6d5972012-09-18 04:03:34 +0000253}
Andrew Trick780fae82012-10-09 23:44:32 +0000254
Matthias Braun42e1e662015-05-14 18:01:13 +0000255unsigned
256TargetSchedModel::computeInstrLatency(const MCSchedClassDesc &SCDesc) const {
Andrea Di Biagio30c1ba42018-03-13 15:22:13 +0000257 return capLatency(MCSchedModel::computeInstrLatency(*STI, SCDesc));
Matthias Braun42e1e662015-05-14 18:01:13 +0000258}
259
Gerolf Hoflehner5e1207e2014-08-03 21:35:39 +0000260unsigned TargetSchedModel::computeInstrLatency(unsigned Opcode) const {
261 assert(hasInstrSchedModel() && "Only call this function with a SchedModel");
Gerolf Hoflehner5e1207e2014-08-03 21:35:39 +0000262 unsigned SCIdx = TII->get(Opcode).getSchedClass();
Andrea Di Biagiobe8616f2018-05-31 13:30:42 +0000263 return capLatency(SchedModel.computeInstrLatency(*STI, SCIdx));
264}
265
266unsigned TargetSchedModel::computeInstrLatency(const MCInst &Inst) const {
267 if (hasInstrSchedModel())
268 return capLatency(SchedModel.computeInstrLatency(*STI, *TII, Inst));
269 return computeInstrLatency(Inst.getOpcode());
Gerolf Hoflehner5e1207e2014-08-03 21:35:39 +0000270}
271
Arnold Schwaighoferd2f96b92013-09-30 15:28:56 +0000272unsigned
273TargetSchedModel::computeInstrLatency(const MachineInstr *MI,
274 bool UseDefaultDefLatency) const {
Andrew Trickc334bd42012-10-10 05:43:18 +0000275 // For the itinerary model, fall back to the old subtarget hook.
276 // Allow subtargets to compute Bundle latencies outside the machine model.
Arnold Schwaighoferd2f96b92013-09-30 15:28:56 +0000277 if (hasInstrItineraries() || MI->isBundle() ||
278 (!hasInstrSchedModel() && !UseDefaultDefLatency))
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000279 return TII->getInstrLatency(&InstrItins, *MI);
Andrew Trickc334bd42012-10-10 05:43:18 +0000280
Andrew Trick780fae82012-10-09 23:44:32 +0000281 if (hasInstrSchedModel()) {
Andrew Trick780fae82012-10-09 23:44:32 +0000282 const MCSchedClassDesc *SCDesc = resolveSchedClass(MI);
Matthias Braun42e1e662015-05-14 18:01:13 +0000283 if (SCDesc->isValid())
284 return computeInstrLatency(*SCDesc);
Andrew Trick780fae82012-10-09 23:44:32 +0000285 }
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000286 return TII->defaultDefLatency(SchedModel, *MI);
Andrew Trick780fae82012-10-09 23:44:32 +0000287}
Andrew Trickdd79f0f2012-10-10 05:43:09 +0000288
289unsigned TargetSchedModel::
290computeOutputLatency(const MachineInstr *DefMI, unsigned DefOperIdx,
291 const MachineInstr *DepMI) const {
Junmo Park11811922016-06-21 08:09:58 +0000292 if (!SchedModel.isOutOfOrder())
Andrew Trickdd79f0f2012-10-10 05:43:09 +0000293 return 1;
294
Junmo Park11811922016-06-21 08:09:58 +0000295 // Out-of-order processor can dispatch WAW dependencies in the same cycle.
Andrew Trickdd79f0f2012-10-10 05:43:09 +0000296
297 // Treat predication as a data dependency for out-of-order cpus. In-order
298 // cpus do not need to treat predicated writes specially.
299 //
300 // TODO: The following hack exists because predication passes do not
301 // correctly append imp-use operands, and readsReg() strangely returns false
302 // for predicated defs.
303 unsigned Reg = DefMI->getOperand(DefOperIdx).getReg();
Justin Bognerfdf9bf42017-10-10 23:50:49 +0000304 const MachineFunction &MF = *DefMI->getMF();
Eric Christopherfc6de422014-08-05 02:39:49 +0000305 const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
Duncan P. N. Exon Smith6307eb52016-02-23 02:46:52 +0000306 if (!DepMI->readsRegister(Reg, TRI) && TII->isPredicated(*DepMI))
Andrew Trickdd79f0f2012-10-10 05:43:09 +0000307 return computeInstrLatency(DefMI);
308
309 // If we have a per operand scheduling model, check if this def is writing
310 // an unbuffered resource. If so, it treated like an in-order cpu.
311 if (hasInstrSchedModel()) {
312 const MCSchedClassDesc *SCDesc = resolveSchedClass(DefMI);
Andrew Trick5f35afb2012-10-11 05:37:06 +0000313 if (SCDesc->isValid()) {
314 for (const MCWriteProcResEntry *PRI = STI->getWriteProcResBegin(SCDesc),
315 *PRE = STI->getWriteProcResEnd(SCDesc); PRI != PRE; ++PRI) {
Andrew Trickde2109e2013-06-15 04:49:57 +0000316 if (!SchedModel.getProcResource(PRI->ProcResourceIdx)->BufferSize)
Andrew Trick5f35afb2012-10-11 05:37:06 +0000317 return 1;
318 }
Andrew Trickdd79f0f2012-10-10 05:43:09 +0000319 }
320 }
321 return 0;
322}
Andrew V. Tischenko75745d02017-04-14 07:44:23 +0000323
Sanjay Patel59313be2018-06-05 23:34:45 +0000324double
Andrea Di Biagiob9acf132018-04-15 17:32:17 +0000325TargetSchedModel::computeReciprocalThroughput(const MachineInstr *MI) const {
326 if (hasInstrItineraries()) {
327 unsigned SchedClass = MI->getDesc().getSchedClass();
328 return MCSchedModel::getReciprocalThroughput(SchedClass,
329 *getInstrItineraries());
330 }
331
Andrew V. Tischenko75745d02017-04-14 07:44:23 +0000332 if (hasInstrSchedModel())
Andrea Di Biagio7faea7c2018-03-13 16:28:55 +0000333 return MCSchedModel::getReciprocalThroughput(*STI, *resolveSchedClass(MI));
Sanjay Patel59313be2018-06-05 23:34:45 +0000334
335 return 0.0;
Andrew V. Tischenko75745d02017-04-14 07:44:23 +0000336}
337
Sanjay Patel59313be2018-06-05 23:34:45 +0000338double
Andrea Di Biagiob9acf132018-04-15 17:32:17 +0000339TargetSchedModel::computeReciprocalThroughput(unsigned Opcode) const {
Andrew V. Tischenko75745d02017-04-14 07:44:23 +0000340 unsigned SchedClass = TII->get(Opcode).getSchedClass();
341 if (hasInstrItineraries())
Andrea Di Biagiob9acf132018-04-15 17:32:17 +0000342 return MCSchedModel::getReciprocalThroughput(SchedClass,
343 *getInstrItineraries());
Andrew V. Tischenko75745d02017-04-14 07:44:23 +0000344 if (hasInstrSchedModel()) {
Andrea Di Biagio7faea7c2018-03-13 16:28:55 +0000345 const MCSchedClassDesc &SCDesc = *SchedModel.getSchedClassDesc(SchedClass);
346 if (SCDesc.isValid() && !SCDesc.isVariant())
347 return MCSchedModel::getReciprocalThroughput(*STI, SCDesc);
Andrew V. Tischenko75745d02017-04-14 07:44:23 +0000348 }
Sanjay Patel59313be2018-06-05 23:34:45 +0000349
350 return 0.0;
Andrew V. Tischenko75745d02017-04-14 07:44:23 +0000351}
Andrea Di Biagiobe8616f2018-05-31 13:30:42 +0000352
Sanjay Patel59313be2018-06-05 23:34:45 +0000353double
Andrea Di Biagiobe8616f2018-05-31 13:30:42 +0000354TargetSchedModel::computeReciprocalThroughput(const MCInst &MI) const {
355 if (hasInstrSchedModel())
356 return SchedModel.getReciprocalThroughput(*STI, *TII, MI);
357 return computeReciprocalThroughput(MI.getOpcode());
358}
359