llvm-6502/tools/bugpoint
Chris Lattner a3efca16f2 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!).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22387 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 01:00:32 +00:00
..
BugDriver.cpp Remove trailing whitespace 2005-04-22 00:00:37 +00:00
BugDriver.h Eliminate tabs and trailing spaces 2005-04-22 04:13:13 +00:00
bugpoint.cpp Remove trailing whitespace 2005-04-22 00:00:37 +00:00
CrashDebugger.cpp Final Changes For PR495: 2005-07-08 03:08:58 +00:00
ExecutionDriver.cpp Final Changes For PR495: 2005-07-08 03:08:58 +00:00
ExtractFunction.cpp Remove trailing whitespace 2005-04-22 00:00:37 +00:00
ListReducer.h Remove trailing whitespace 2005-04-22 00:00:37 +00:00
Makefile Two changes: 2005-04-22 17:14:14 +00:00
Miscompilation.cpp Fix PR576. 2005-07-12 01:00:32 +00:00
OptimizerDriver.cpp Final Changes For PR495: 2005-07-08 03:08:58 +00:00
TestPasses.cpp Remove trailing whitespace 2005-04-22 00:00:37 +00:00
ToolRunner.cpp Final Changes For PR495: 2005-07-08 03:08:58 +00:00
ToolRunner.h Remove trailing whitespace 2005-04-21 20:48:15 +00:00