diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-10-06 15:41:21 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-10-06 15:41:21 +0000 |
commit | 2c9b913fc0fe0c6b2e41e84fc80f905a743ca054 (patch) | |
tree | e29a8a6b395decaf4df15f2f7818f11402e6044b /lib/Target/X86 | |
parent | 1bb9a4878d1b4f82c7072c68b85ffebc39fc89e6 (diff) | |
download | external_llvm-2c9b913fc0fe0c6b2e41e84fc80f905a743ca054.zip external_llvm-2c9b913fc0fe0c6b2e41e84fc80f905a743ca054.tar.gz external_llvm-2c9b913fc0fe0c6b2e41e84fc80f905a743ca054.tar.bz2 |
Add # of printed instructions statistic to both the SPARC and X86 LLC backends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/Printer.cpp | 4 | ||||
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/X86/Printer.cpp b/lib/Target/X86/Printer.cpp index d36f298..fbc6b6e 100644 --- a/lib/Target/X86/Printer.cpp +++ b/lib/Target/X86/Printer.cpp @@ -18,10 +18,13 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Mangler.h" +#include "Support/Statistic.h" #include "Support/StringExtras.h" #include "Support/CommandLine.h" namespace { + Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed"); + // FIXME: This should be automatically picked up by autoconf from the C // frontend cl::opt<bool> EmitCygwin("enable-cygwin-compatible-output", cl::Hidden, @@ -573,6 +576,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) { const TargetInstrInfo &TII = TM.getInstrInfo(); const TargetInstrDescriptor &Desc = TII.get(Opcode); + ++EmittedInsts; switch (Desc.TSFlags & X86II::FormMask) { case X86II::Pseudo: // Print pseudo-instructions as comments; either they should have been diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index d36f298..fbc6b6e 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -18,10 +18,13 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Mangler.h" +#include "Support/Statistic.h" #include "Support/StringExtras.h" #include "Support/CommandLine.h" namespace { + Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed"); + // FIXME: This should be automatically picked up by autoconf from the C // frontend cl::opt<bool> EmitCygwin("enable-cygwin-compatible-output", cl::Hidden, @@ -573,6 +576,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) { const TargetInstrInfo &TII = TM.getInstrInfo(); const TargetInstrDescriptor &Desc = TII.get(Opcode); + ++EmittedInsts; switch (Desc.TSFlags & X86II::FormMask) { case X86II::Pseudo: // Print pseudo-instructions as comments; either they should have been |