diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-06-16 18:09:26 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-06-16 18:09:26 +0000 |
| commit | e796266d587b7f02ef710172935fefee79914c12 (patch) | |
| tree | 50d65773d935b5767eb5b8db3123ea319d3c5fac /llvm/lib/ExecutionEngine | |
| parent | 91f228b2913c91ae83e1dcf052d784adc2c29546 (diff) | |
| download | bcm5719-llvm-e796266d587b7f02ef710172935fefee79914c12.tar.gz bcm5719-llvm-e796266d587b7f02ef710172935fefee79914c12.zip | |
Only count instructions as code size, not constant pools and other per-function stuff.
llvm-svn: 28827
Diffstat (limited to 'llvm/lib/ExecutionEngine')
| -rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp index c8056613f06..4300b177379 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -760,8 +760,14 @@ bool JITEmitter::finishFunction(MachineFunction &F) { emitJumpTableInfo(F.getJumpTableInfo()); - MemMgr.endFunctionBody(F.getFunction(), BufferBegin, CurBufferPtr); - NumBytes += getCurrentPCOffset(); + // FnStart is the start of the text, not the start of the constant pool and + // other per-function data. + unsigned char *FnStart = + (unsigned char *)TheJIT->getPointerToGlobalIfAvailable(F.getFunction()); + unsigned char *FnEnd = CurBufferPtr; + + MemMgr.endFunctionBody(F.getFunction(), BufferBegin, FnEnd); + NumBytes += FnEnd-FnStart; if (!Relocations.empty()) { NumRelos += Relocations.size(); @@ -815,11 +821,9 @@ bool JITEmitter::finishFunction(MachineFunction &F) { } } - DEBUG(void *FnStart = TheJIT->getPointerToGlobalIfAvailable(F.getFunction()); - char *FnEnd = (char*)getCurrentPCOffset(); - std::cerr << "JIT: Finished CodeGen of [" << FnStart + DEBUG(std::cerr << "JIT: Finished CodeGen of [" << (void*)FnStart << "] Function: " << F.getFunction()->getName() - << ": " << (FnEnd-(char*)FnStart) << " bytes of text, " + << ": " << (FnEnd-FnStart) << " bytes of text, " << Relocations.size() << " relocations\n"); Relocations.clear(); return false; |

