@@ -29,7 +29,8 @@ InstrBuilder::InstrBuilder(const llvm::MCSubtargetInfo &sti,
29
29
const llvm::MCInstrInfo &mcii,
30
30
const llvm::MCRegisterInfo &mri,
31
31
const llvm::MCInstrAnalysis &mcia)
32
- : STI(sti), MCII(mcii), MRI(mri), MCIA(mcia) {
32
+ : STI(sti), MCII(mcii), MRI(mri), MCIA(mcia), FirstCallInst(true ),
33
+ FirstReturnInst (true ) {
33
34
computeProcResourceMasks (STI.getSchedModel (), ProcResourceMasks);
34
35
}
35
36
@@ -455,17 +456,19 @@ InstrBuilder::createInstrDescImpl(const MCInst &MCI) {
455
456
std::unique_ptr<InstrDesc> ID = llvm::make_unique<InstrDesc>();
456
457
ID->NumMicroOps = SCDesc.NumMicroOps ;
457
458
458
- if (MCDesc.isCall ()) {
459
+ if (MCDesc.isCall () && FirstCallInst ) {
459
460
// We don't correctly model calls.
460
461
WithColor::warning () << " found a call in the input assembly sequence.\n " ;
461
462
WithColor::note () << " call instructions are not correctly modeled. "
462
463
<< " Assume a latency of 100cy.\n " ;
464
+ FirstCallInst = false ;
463
465
}
464
466
465
- if (MCDesc.isReturn ()) {
467
+ if (MCDesc.isReturn () && FirstReturnInst ) {
466
468
WithColor::warning () << " found a return instruction in the input"
467
469
<< " assembly sequence.\n " ;
468
470
WithColor::note () << " program counter updates are ignored.\n " ;
471
+ FirstReturnInst = false ;
469
472
}
470
473
471
474
ID->MayLoad = MCDesc.mayLoad ();
0 commit comments