summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2012-12-07 17:59:21 +0000
committerEli Bendersky <eliben@google.com>2012-12-07 17:59:21 +0000
commit2ccd044c2223312f61f191aeb34cc745f8bbbb74 (patch)
tree642316c6698dd1dc4c11723bcc34ac4ddb15a101 /llvm
parent327c267a9561d52e691b732c0f0dcfea4ddebeae (diff)
downloadbcm5719-llvm-2ccd044c2223312f61f191aeb34cc745f8bbbb74.tar.gz
bcm5719-llvm-2ccd044c2223312f61f191aeb34cc745f8bbbb74.zip
Add separate statistics for Data and Inst fragments emitted during relaxation.
Also fixes a test that was overly-sensitive to the exact order of statistics emitted. llvm-svn: 169619
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/MC/MCAssembler.cpp6
-rw-r--r--llvm/test/MC/ELF/no-fixup.s5
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 457abd2a0aa..5032e6fff69 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -33,7 +33,9 @@ using namespace llvm;
namespace {
namespace stats {
-STATISTIC(EmittedFragments, "Number of emitted assembler fragments");
+STATISTIC(EmittedFragments, "Number of emitted assembler fragments - total");
+STATISTIC(EmittedInstFragments, "Number of emitted assembler fragments - instruction");
+STATISTIC(EmittedDataFragments, "Number of emitted assembler fragments - data");
STATISTIC(evaluateFixup, "Number of evaluated fixups");
STATISTIC(FragmentLayouts, "Number of fragment layouts");
STATISTIC(ObjectBytes, "Number of emitted object file bytes");
@@ -432,6 +434,7 @@ static void WriteFragmentData(const MCAssembler &Asm, const MCAsmLayout &Layout,
}
case MCFragment::FT_Data: {
+ ++stats::EmittedDataFragments;
MCDataFragment &DF = cast<MCDataFragment>(F);
assert(FragmentSize == DF.getContents().size() && "Invalid size!");
OW->WriteBytes(DF.getContents().str());
@@ -456,6 +459,7 @@ static void WriteFragmentData(const MCAssembler &Asm, const MCAsmLayout &Layout,
}
case MCFragment::FT_Inst: {
+ ++stats::EmittedInstFragments;
MCInstFragment &IF = cast<MCInstFragment>(F);
OW->WriteBytes(StringRef(IF.getCode().begin(), IF.getCode().size()));
break;
diff --git a/llvm/test/MC/ELF/no-fixup.s b/llvm/test/MC/ELF/no-fixup.s
index 6e719bcc8c1..8cc299fb24b 100644
--- a/llvm/test/MC/ELF/no-fixup.s
+++ b/llvm/test/MC/ELF/no-fixup.s
@@ -4,11 +4,8 @@
// Test that we create no fixups for this file since "a" and "b" are in the
// same fragment.
-// CHECK: assembler - Number of assembler layout and relaxation steps
-// CHECK-NEXT: assembler - Number of emitted assembler fragments
-// CHECK-NEXT: assembler - Number of emitted object file bytes
+// CHECK: assembler - Number of emitted object file bytes
// CHECK-NEXT: assembler - Number of fragment layouts
-// CHECK-NEXT: mcexpr - Number of MCExpr evaluations
a:
nop
OpenPOWER on IntegriCloud