From 1cf5024de165001aad045934425f37d418f2c657 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 11 Jun 2004 15:10:38 +0000 Subject: 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 --- lib/Bytecode/Reader/Analyzer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Bytecode/Reader/Analyzer.cpp') diff --git a/lib/Bytecode/Reader/Analyzer.cpp b/lib/Bytecode/Reader/Analyzer.cpp index d8e7595..9468094 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& 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); -- cgit v1.1