1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/tools
Chris Lattner eb6bad32e9 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
..
analyze Two changes: 2005-04-22 17:14:14 +00:00
bugpoint Fix PR576. 2005-07-12 01:00:32 +00:00
gccas Move licm after reassociate, add some cond-propagate passes 2005-05-07 22:45:35 +00:00
gccld Make sure we don't error out if an invalid path is used, just simply 2005-07-08 16:48:52 +00:00
llc add a new -filetype argument to llc. 2005-06-25 03:32:05 +00:00
lli
llvm-ar Final Changes For PR495: 2005-07-08 03:08:58 +00:00
llvm-as There are still uses for spaces in Makefiles -- to make text line up together, 2005-04-24 17:43:41 +00:00
llvm-bcanalyzer
llvm-db
llvm-dis
llvm-extract extract has been renamed to llvm-extract to avoid conflicting with another tool 2005-04-24 17:36:05 +00:00
llvm-ld Final Changes For PR495: 2005-07-08 03:08:58 +00:00
llvm-link For PR495: 2005-07-07 23:21:43 +00:00
llvm-nm For PR495: 2005-07-07 18:21:42 +00:00
llvm-prof There are still uses for spaces in Makefiles -- to make text line up together, 2005-04-24 17:43:41 +00:00
llvm-ranlib For PR495: 2005-07-07 23:21:43 +00:00
llvm-stub
llvmc Final Changes For PR495: 2005-07-08 03:08:58 +00:00
opt Two changes: 2005-04-22 17:14:14 +00:00
Makefile extract has been renamed to llvm-extract to avoid conflicting with another tool 2005-04-24 17:46:58 +00:00