gallivm: More fallout from disabling with LLVM 3.6

The draw module would still try to use gallivm, causing many piglit tests
to fail with an assertion failure. llvmpipe might have been similarly
affected.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
This commit is contained in:
Michel Dänzer 2014-09-25 12:23:02 +09:00 committed by Michel Dänzer
parent cdc4de1215
commit 4a38b154fd
8 changed files with 26 additions and 15 deletions

View File

@ -93,8 +93,6 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm)
#if HAVE_LLVM
if (try_llvm && draw_get_option_use_llvm()) {
draw->llvm = draw_llvm_create(draw);
if (!draw->llvm)
goto err_destroy;
}
#endif

View File

@ -484,12 +484,13 @@ draw_llvm_create(struct draw_context *draw)
{
struct draw_llvm *llvm;
if (!lp_build_init())
return NULL;
llvm = CALLOC_STRUCT( draw_llvm );
if (!llvm)
return NULL;
lp_build_init();
llvm->draw = draw;
llvm->nr_variants = 0;

View File

@ -306,7 +306,8 @@ init_gallivm_state(struct gallivm_state *gallivm, const char *name)
assert(!gallivm->context);
assert(!gallivm->module);
lp_build_init();
if (!lp_build_init())
return FALSE;
if (USE_GLOBAL_CONTEXT) {
gallivm->context = LLVMGetGlobalContext();
@ -382,11 +383,18 @@ fail:
}
void
boolean
lp_build_init(void)
{
if (gallivm_initialized)
return;
return TRUE;
/* XXX: Remove this once lp_bld_misc.cpp has been adapted to the removal
* of JITMemoryManager
*/
#if HAVE_LLVM >= 0x0306
return FALSE;
#endif
#ifdef DEBUG
gallivm_debug = debug_get_option_gallivm_debug();
@ -477,6 +485,8 @@ lp_build_init(void)
util_cpu_caps.has_avx = 0;
util_cpu_caps.has_f16c = 0;
#endif
return TRUE;
}

View File

@ -49,7 +49,7 @@ struct gallivm_state
};
void
boolean
lp_build_init(void);

View File

@ -231,10 +231,10 @@ lp_jit_screen_cleanup(struct llvmpipe_screen *screen)
}
void
boolean
lp_jit_screen_init(struct llvmpipe_screen *screen)
{
lp_build_init();
return lp_build_init();
}

View File

@ -252,7 +252,7 @@ void
lp_jit_screen_cleanup(struct llvmpipe_screen *screen);
void
boolean
lp_jit_screen_init(struct llvmpipe_screen *screen);

View File

@ -557,6 +557,9 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
return NULL;
#endif
if (!lp_jit_screen_init(screen))
return NULL;
#ifdef DEBUG
LP_DEBUG = debug_get_flags_option("LP_DEBUG", lp_debug_flags, 0 );
#endif
@ -588,8 +591,6 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
llvmpipe_init_screen_resource_funcs(&screen->base);
lp_jit_screen_init(screen);
screen->num_threads = util_cpu_caps.nr_cpus > 1 ? util_cpu_caps.nr_cpus : 0;
#ifdef PIPE_SUBSYSTEM_EMBEDDED
screen->num_threads = 0;

View File

@ -376,6 +376,9 @@ int main(int argc, char **argv)
fpstate = util_fpstate_get();
util_fpstate_set_denorms_to_zero(fpstate);
if (!lp_build_init())
return 1;
for(i = 1; i < argc; ++i) {
if(strcmp(argv[i], "-v") == 0)
++verbose;
@ -387,8 +390,6 @@ int main(int argc, char **argv)
n = atoi(argv[i]);
}
lp_build_init();
#ifdef DEBUG
if (verbose >= 2) {
gallivm_debug |= GALLIVM_DEBUG_IR;