llvm-project/llvm
Chris Lattner 986675cb75 Fix PR576.
Instead of emitting a JIT stub that looks like this:

internal void %l1_main_entry_2E_ce_wrapper(int) {
header:
        %resolver = call sbyte* %getPointerToNamedFunction( sbyte* getelementptr ([20 x sbyte]* %l1_main_entry_2E_ce_name, int 0, int 0) )           ; <sbyte*> [#uses=1]
        %resolverCast = cast sbyte* %resolver to void (int)*            ; <void (int)*> [#uses=1]
        call void %resolverCast( int %0 )
        ret void
}

Emit one that looks like this:

internal void %l1_main_entry_2E_ce_wrapper(int) {
Entry:
	%fpcache = load void (int)** %l1_main_entry_2E_ce.fpcache               ; <void (int)*> [#uses=2]
        %isNull = seteq void (int)* %fpcache, null              ; <bool> [#uses=1]
        br bool %isNull, label %lookupfp, label %usecache

usecache:               ; preds = %lookupfp, %Entry
        %fp = phi void (int)* [ %resolverCast, %lookupfp ], [ %fpcache, %Entry ]            ; <void (int)*> [#uses=1]
        call void %fp( int %0 )
        ret void

lookupfp:               ; preds = %Entry
        %resolver = call sbyte* %getPointerToNamedFunction( sbyte* getelementptr ([20 x sbyte]* %l1_main_entry_2E_ce_name, int 0, int 0) )           ; <sbyte*> [#uses=1]
        %resolverCast = cast sbyte* %resolver to void (int)*            ; <void (int)*> [#uses=2]
        store void (int)* %resolverCast, void (int)** %l1_main_entry_2E_ce.fpcache
        br label %usecache
}


This makes the JIT debugger *MUCH* faster on large programs, as
getPointerToNamedFunction takes time linear with the size of the program, and
before we would call it every time a function in the text module was called from
the safe module (ouch!).

llvm-svn: 22387
2005-07-12 01:00:32 +00:00
..
autoconf We also have V8, so do not force every Sparc to be treated like a V9. It is 2005-06-06 19:29:36 +00:00
docs add a note so I can remember the common t-t's 2005-07-12 00:20:49 +00:00
examples Don't forget these are calls 2005-05-06 06:21:59 +00:00
include/llvm The symbol table just needs a const GlobalValue*, not a non-const one. 2005-07-11 06:16:24 +00:00
lib fix a warning 2005-07-11 22:46:18 +00:00
projects oops 2005-07-05 16:36:18 +00:00
runtime Remove trailing whitespace 2005-04-21 23:48:37 +00:00
test New testcase distilled from a large chunk of code Misha sent me. 2005-07-07 20:39:45 +00:00
tools Fix PR576. 2005-07-12 01:00:32 +00:00
utils * Add ability to specify the target LLVM will compile for via configure 2005-06-06 19:17:05 +00:00
win32 Adding new files to Visual Studio projects. 2005-07-02 02:04:26 +00:00
.cvsignore Ignore the configure.out file generated by "make reconfigure" 2005-06-18 23:01:25 +00:00
CREDITS.TXT Improve statement 2005-05-15 21:38:32 +00:00
LICENSE.TXT Remove extraneous colons after program names for consistency 2005-05-12 21:39:01 +00:00
Makefile Make sure the tools get built if no build target is specified. 2005-05-29 00:49:24 +00:00
Makefile.common Update comments to reflect new variable names. Patch contributed by 2005-02-14 16:02:19 +00:00
Makefile.config.in Two changes: 2005-04-22 17:14:14 +00:00
Makefile.rules Two dist-check related changes: 2005-05-24 02:33:20 +00:00
README.txt Make the text of this file a little more useful. 2004-09-02 22:49:27 +00:00
configure Fix the definitions of LLVMGCC and LLVMGXX to include the EXEEXT (the 2005-06-02 22:34:49 +00:00
llvm.spec Onward to LLVM-1.6 and beyond! 2005-05-18 20:23:20 +00:00

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level 
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments. 

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.