aboutsummaryrefslogtreecommitdiff
path: root/lib/MC
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2012-12-10 18:59:39 +0000
committerEli Bendersky <eliben@google.com>2012-12-10 18:59:39 +0000
commit6ac81f59a7954bd883bb194552eef1d91d04ad17 (patch)
treead5f86c00aab269925c74f63786225594b4d7bfb /lib/MC
parentf21831073ca474601620d1a29258176b0deaedb2 (diff)
This patch adds statistics for other non-DWARF fragments emitted by
the assembler. This is useful in order to know how the numbers add up, since in particular the Align fragments account for a non-trivial portion of the emitted fragments (especially on -O0 which sets relax-all). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCAssembler.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index 989d8be0af..e8aa924b8f 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -34,8 +34,16 @@ using namespace llvm;
namespace {
namespace stats {
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(EmittedInstFragments,
+ "Number of emitted assembler fragments - instruction");
+STATISTIC(EmittedDataFragments,
+ "Number of emitted assembler fragments - data");
+STATISTIC(EmittedAlignFragments,
+ "Number of emitted assembler fragments - align");
+STATISTIC(EmittedFillFragments,
+ "Number of emitted assembler fragments - fill");
+STATISTIC(EmittedOrgFragments,
+ "Number of emitted assembler fragments - org");
STATISTIC(evaluateFixup, "Number of evaluated fixups");
STATISTIC(FragmentLayouts, "Number of fragment layouts");
STATISTIC(ObjectBytes, "Number of emitted object file bytes");
@@ -407,6 +415,7 @@ static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout,
uint64_t FragmentSize = Asm.computeFragmentSize(Layout, F);
switch (F.getKind()) {
case MCFragment::FT_Align: {
+ ++stats::EmittedAlignFragments;
MCAlignFragment &AF = cast<MCAlignFragment>(F);
uint64_t Count = FragmentSize / AF.getValueSize();
@@ -456,6 +465,7 @@ static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout,
break;
case MCFragment::FT_Fill: {
+ ++stats::EmittedFillFragments;
MCFillFragment &FF = cast<MCFillFragment>(F);
assert(FF.getValueSize() && "Invalid virtual align in concrete fragment!");
@@ -479,6 +489,7 @@ static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout,
}
case MCFragment::FT_Org: {
+ ++stats::EmittedOrgFragments;
MCOrgFragment &OF = cast<MCOrgFragment>(F);
for (uint64_t i = 0, e = FragmentSize; i != e; ++i)