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 | c0999e134ed75e8833d8204a8712001ac80ccd41 (patch) | |
tree | f0b5abb63e259fb231978352510f69510bb82c17 /llvm/lib/Bytecode/Reader/Analyzer.cpp | |
parent | 80ae844ea87333c06c351faf5920da9533df801e (diff) | |
download | bcm5719-llvm-c0999e134ed75e8833d8204a8712001ac80ccd41.tar.gz bcm5719-llvm-c0999e134ed75e8833d8204a8712001ac80ccd41.zip |
Implement tracking of bytecode instruction size and the number of long
instructions generated.
llvm-svn: 14154
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Analyzer.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Reader/Analyzer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Reader/Analyzer.cpp b/llvm/lib/Bytecode/Reader/Analyzer.cpp index d8e75957bbe..94680949cb5 100644 --- a/llvm/lib/Bytecode/Reader/Analyzer.cpp +++ b/llvm/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); |