aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-02-10 13:18:44 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-02-10 13:18:44 +0000
commitbf152d57a4c909bf408407924166e981dce84ee3 (patch)
tree783e6e25459c128bfbd5881ca3f1aa1386e16a3a /llvm/lib/CodeGen/MachineInstr.cpp
parent63168c75333b0c8dc74e337d71fe3411b2781577 (diff)
downloadllvm-bf152d57a4c909bf408407924166e981dce84ee3.zip
llvm-bf152d57a4c909bf408407924166e981dce84ee3.tar.gz
llvm-bf152d57a4c909bf408407924166e981dce84ee3.tar.bz2
Put instruction names into an indexed string table on the side, removing a pointer from MCInstrDesc.
Make them accessible through MCInstrInfo. They are only used for debugging purposes so this doesn't have an impact on performance. X86MCTargetDesc.o goes from 630K to 461K on x86_64. llvm-svn: 150245
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index fc5822d..0a65734 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1484,7 +1484,10 @@ void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM) const {
OS << " = ";
// Print the opcode name.
- OS << getDesc().getName();
+ if (TM && TM->getInstrInfo())
+ OS << TM->getInstrInfo()->getName(getOpcode());
+ else
+ OS << "UNKNOWN";
// Print the rest of the operands.
bool OmittedAnyCallClobbers = false;