From 5f09cb0dba41256f96e33f53889c43c4a6f69aff Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Wed, 2 Oct 2013 22:07:57 +0000 Subject: [llvm-c][Disassembler] Add an option to print latency information in disassembled output alongside the instructions. E.g., on a vector shuffle operation with a memory operand, disassembled outputs are: * Without the option: vpshufd $-0x79, (%rsp), %xmm0 * With the option: vpshufd $-0x79, (%rsp), %xmm0 ## Latency: 5 The printed latency is extracted from the schedule model available in the disassembler context. Thus, this option has no effect if there is not a scheduling model for the target. This boils down to one may need to specify the CPU string, so that this option could have an effect. Note: Latency < 2 are not printed. This part of . llvm-svn: 191859 --- llvm/lib/MC/MCDisassembler/Disassembler.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/MC/MCDisassembler/Disassembler.h') diff --git a/llvm/lib/MC/MCDisassembler/Disassembler.h b/llvm/lib/MC/MCDisassembler/Disassembler.h index 6eb59d0c57b..05c92dff17c 100644 --- a/llvm/lib/MC/MCDisassembler/Disassembler.h +++ b/llvm/lib/MC/MCDisassembler/Disassembler.h @@ -73,6 +73,8 @@ private: llvm::OwningPtr DisAsm; // The instruction printer for the target architecture. llvm::OwningPtr IP; + // The options used to set up the disassembler. + uint64_t Options; public: // Comment stream and backing vector. @@ -90,6 +92,7 @@ public: MCInstPrinter *iP) : TripleName(tripleName), DisInfo(disInfo), TagType(tagType), GetOpInfo(getOpInfo), SymbolLookUp(symbolLookUp), TheTarget(theTarget), + Options(0), CommentStream(CommentsToEmit) { MAI.reset(mAI); MRI.reset(mRI); @@ -114,6 +117,8 @@ public: const MCSubtargetInfo *getSubtargetInfo() const { return MSI.get(); } MCInstPrinter *getIP() { return IP.get(); } void setIP(MCInstPrinter *NewIP) { IP.reset(NewIP); } + uint64_t getOptions() const { return Options; } + void addOptions(uint64_t Options) { this->Options |= Options; } }; } // namespace llvm -- cgit v1.2.3