From c1fe1474d27f6fe7b8e5bfedcc9066e9a90ad85e Mon Sep 17 00:00:00 2001 From: Michael Maitland Date: Fri, 12 May 2023 09:56:43 -0700 Subject: [llvm-mca] Print InstructionInfoView using Instrument information. Previous reports calculated the overall report using Instrument information but did not print out per-instruction data using Instrument information. This patch fixes that. Differential Revision: https://reviews.llvm.org/D150459 --- llvm/tools/llvm-mca/llvm-mca.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'llvm/tools/llvm-mca/llvm-mca.cpp') diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp index 23b537e..eb71cff 100644 --- a/llvm/tools/llvm-mca/llvm-mca.cpp +++ b/llvm/tools/llvm-mca/llvm-mca.cpp @@ -571,11 +571,14 @@ int main(int argc, char **argv) { IPP->resetState(); + DenseMap> + InstToInstruments; SmallVector> LoweredSequence; for (const MCInst &MCI : Insts) { SMLoc Loc = MCI.getLoc(); const SmallVector Instruments = InstrumentRegions.getActiveInstruments(Loc); + InstToInstruments.insert({&MCI, Instruments}); Expected> Inst = IB.createInstruction(MCI, Instruments); @@ -621,7 +624,7 @@ int main(int argc, char **argv) { if (PrintInstructionInfoView) { Printer.addView(std::make_unique( *STI, *MCII, CE, ShowEncoding, Insts, *IP, LoweredSequence, - ShowBarriers)); + ShowBarriers, *IM, InstToInstruments)); } Printer.addView( std::make_unique(*STI, *IP, Insts)); @@ -698,7 +701,7 @@ int main(int argc, char **argv) { if (PrintInstructionInfoView) Printer.addView(std::make_unique( *STI, *MCII, CE, ShowEncoding, Insts, *IP, LoweredSequence, - ShowBarriers)); + ShowBarriers, *IM, InstToInstruments)); // Fetch custom Views that are to be placed after the InstructionInfoView. // Refer to the comment paired with the CB->getStartViews(*IP, Insts); line -- cgit v1.1