diff options
author | Quentin Colombet <qcolombet@apple.com> | 2013-10-02 22:07:57 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2013-10-02 22:07:57 +0000 |
commit | 797f06e19b6f17217a69dea4d6ce900625432595 (patch) | |
tree | 3dc66bee70b78d434a028c2e8a7d7206f465916a /lib/MC/MCDisassembler/Disassembler.h | |
parent | 18b222a87264145979de8216e7243b0ac8921c9d (diff) | |
download | external_llvm-797f06e19b6f17217a69dea4d6ce900625432595.tar.gz external_llvm-797f06e19b6f17217a69dea4d6ce900625432595.tar.bz2 external_llvm-797f06e19b6f17217a69dea4d6ce900625432595.zip |
[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 <rdar://problem/14687488>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCDisassembler/Disassembler.h')
-rw-r--r-- | lib/MC/MCDisassembler/Disassembler.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/MC/MCDisassembler/Disassembler.h b/lib/MC/MCDisassembler/Disassembler.h index 6eb59d0c57..05c92dff17 100644 --- a/lib/MC/MCDisassembler/Disassembler.h +++ b/lib/MC/MCDisassembler/Disassembler.h @@ -73,6 +73,8 @@ private: llvm::OwningPtr<const llvm::MCDisassembler> DisAsm; // The instruction printer for the target architecture. llvm::OwningPtr<llvm::MCInstPrinter> 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 |