@@ -219,11 +219,10 @@ static void initializeUsedResources(InstrDesc &ID,
219219 });
220220}
221221
222- static void computeMaxLatency (InstrDesc &ID, const MCInstrDesc &MCDesc,
223- const MCSchedClassDesc &SCDesc,
224- const MCSubtargetInfo &STI,
225- unsigned CallLatency) {
226- if (MCDesc.isCall ()) {
222+ static void computeMaxLatency (InstrDesc &ID, const MCSchedClassDesc &SCDesc,
223+ const MCSubtargetInfo &STI, unsigned CallLatency,
224+ bool IsCall) {
225+ if (IsCall) {
227226 // We cannot estimate how long this call will take.
228227 // Artificially set an arbitrarily high latency.
229228 ID.MaxLatency = CallLatency;
@@ -599,23 +598,24 @@ InstrBuilder::createInstrDescImpl(const MCInst &MCI,
599598 ID->NumMicroOps = SCDesc.NumMicroOps ;
600599 ID->SchedClassID = SchedClassID;
601600
602- if (MCDesc.isCall () && FirstCallInst) {
601+ bool IsCall = MCIA->isCall (MCI);
602+ if (IsCall && FirstCallInst) {
603603 // We don't correctly model calls.
604604 WithColor::warning () << " found a call in the input assembly sequence.\n " ;
605605 WithColor::note () << " call instructions are not correctly modeled. "
606606 << " Assume a latency of " << CallLatency << " cy.\n " ;
607607 FirstCallInst = false ;
608608 }
609609
610- if (MCDesc. isReturn () && FirstReturnInst) {
610+ if (MCIA-> isReturn (MCI ) && FirstReturnInst) {
611611 WithColor::warning () << " found a return instruction in the input"
612612 << " assembly sequence.\n " ;
613613 WithColor::note () << " program counter updates are ignored.\n " ;
614614 FirstReturnInst = false ;
615615 }
616616
617617 initializeUsedResources (*ID, SCDesc, STI, ProcResourceMasks);
618- computeMaxLatency (*ID, MCDesc, SCDesc, STI, CallLatency);
618+ computeMaxLatency (*ID, SCDesc, STI, CallLatency, IsCall );
619619
620620 if (Error Err = verifyOperands (MCDesc, MCI))
621621 return std::move (Err);
0 commit comments