From 42720603c44a398b0ffeeecf8d15dc9adf808e17 Mon Sep 17 00:00:00 2001 From: Andrea Di Biagio Date: Sat, 24 Nov 2018 18:40:45 +0000 Subject: [llvm-mca] InstrBuilder: warnings for call/ret instructions are only reported once. llvm-svn: 347514 --- llvm/tools/llvm-mca/lib/InstrBuilder.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'llvm/tools/llvm-mca/lib/InstrBuilder.cpp') diff --git a/llvm/tools/llvm-mca/lib/InstrBuilder.cpp b/llvm/tools/llvm-mca/lib/InstrBuilder.cpp index b6c6a01d5ed..f691f466640 100644 --- a/llvm/tools/llvm-mca/lib/InstrBuilder.cpp +++ b/llvm/tools/llvm-mca/lib/InstrBuilder.cpp @@ -29,7 +29,8 @@ InstrBuilder::InstrBuilder(const llvm::MCSubtargetInfo &sti, const llvm::MCInstrInfo &mcii, const llvm::MCRegisterInfo &mri, const llvm::MCInstrAnalysis &mcia) - : STI(sti), MCII(mcii), MRI(mri), MCIA(mcia) { + : STI(sti), MCII(mcii), MRI(mri), MCIA(mcia), FirstCallInst(true), + FirstReturnInst(true) { computeProcResourceMasks(STI.getSchedModel(), ProcResourceMasks); } @@ -455,17 +456,19 @@ InstrBuilder::createInstrDescImpl(const MCInst &MCI) { std::unique_ptr ID = llvm::make_unique(); ID->NumMicroOps = SCDesc.NumMicroOps; - if (MCDesc.isCall()) { + if (MCDesc.isCall() && FirstCallInst) { // We don't correctly model calls. WithColor::warning() << "found a call in the input assembly sequence.\n"; WithColor::note() << "call instructions are not correctly modeled. " << "Assume a latency of 100cy.\n"; + FirstCallInst = false; } - if (MCDesc.isReturn()) { + if (MCDesc.isReturn() && FirstReturnInst) { WithColor::warning() << "found a return instruction in the input" << " assembly sequence.\n"; WithColor::note() << "program counter updates are ignored.\n"; + FirstReturnInst = false; } ID->MayLoad = MCDesc.mayLoad(); -- cgit v1.2.3