diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-06-11 15:10:38 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-06-11 15:10:38 +0000 |
commit | 1cf5024de165001aad045934425f37d418f2c657 (patch) | |
tree | 932dfe7cc6e4820b5c820bca7176418ad7eb27db /lib/Bytecode/Reader/Analyzer.cpp | |
parent | f6d023312fbc6b4e5242b760f2b5769d3290c2d4 (diff) |
Implement tracking of bytecode instruction size and the number of long
instructions generated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/Analyzer.cpp')
-rw-r--r-- | lib/Bytecode/Reader/Analyzer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Bytecode/Reader/Analyzer.cpp b/lib/Bytecode/Reader/Analyzer.cpp index d8e75957bb..94680949cb 100644 --- a/lib/Bytecode/Reader/Analyzer.cpp +++ b/lib/Bytecode/Reader/Analyzer.cpp @@ -52,6 +52,8 @@ public: bca.fileDensity = 0.0; bca.globalsDensity = 0.0; bca.functionDensity = 0.0; + bca.instructionSize = 0; + bca.longInstructions = 0; bca.vbrCount32 = 0; bca.vbrCount64 = 0; bca.vbrCompBytes = 0; @@ -167,6 +169,8 @@ public: currFunc->numPhis = 0; currFunc->numOperands = 0; currFunc->density = 0.0; + currFunc->instructionSize = 0; + currFunc->longInstructions = 0; currFunc->vbrCount32 = 0; currFunc->vbrCount64 = 0; currFunc->vbrCompBytes = 0; @@ -188,9 +192,13 @@ public: std::vector<unsigned>& Operands, unsigned Size) { bca.numInstructions++; bca.numValues++; + bca.instructionSize += Size; + if (Size > 4 ) bca.longInstructions++; bca.numOperands += Operands.size(); if ( currFunc ) { currFunc->numInstructions++; + currFunc->instructionSize += Size; + if (Size > 4 ) currFunc->longInstructions++; if ( Opcode == Instruction::PHI ) currFunc->numPhis++; } return Instruction::isTerminator(Opcode); |