@@ -219,11 +219,10 @@ static void initializeUsedResources(InstrDesc &ID,
219
219
});
220
220
}
221
221
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) {
227
226
// We cannot estimate how long this call will take.
228
227
// Artificially set an arbitrarily high latency.
229
228
ID.MaxLatency = CallLatency;
@@ -599,23 +598,24 @@ InstrBuilder::createInstrDescImpl(const MCInst &MCI,
599
598
ID->NumMicroOps = SCDesc.NumMicroOps ;
600
599
ID->SchedClassID = SchedClassID;
601
600
602
- if (MCDesc.isCall () && FirstCallInst) {
601
+ bool IsCall = MCIA->isCall (MCI);
602
+ if (IsCall && FirstCallInst) {
603
603
// We don't correctly model calls.
604
604
WithColor::warning () << " found a call in the input assembly sequence.\n " ;
605
605
WithColor::note () << " call instructions are not correctly modeled. "
606
606
<< " Assume a latency of " << CallLatency << " cy.\n " ;
607
607
FirstCallInst = false ;
608
608
}
609
609
610
- if (MCDesc. isReturn () && FirstReturnInst) {
610
+ if (MCIA-> isReturn (MCI ) && FirstReturnInst) {
611
611
WithColor::warning () << " found a return instruction in the input"
612
612
<< " assembly sequence.\n " ;
613
613
WithColor::note () << " program counter updates are ignored.\n " ;
614
614
FirstReturnInst = false ;
615
615
}
616
616
617
617
initializeUsedResources (*ID, SCDesc, STI, ProcResourceMasks);
618
- computeMaxLatency (*ID, MCDesc, SCDesc, STI, CallLatency);
618
+ computeMaxLatency (*ID, SCDesc, STI, CallLatency, IsCall );
619
619
620
620
if (Error Err = verifyOperands (MCDesc, MCI))
621
621
return std::move (Err);
0 commit comments