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:
parent
cdc4de1215
commit
4a38b154fd
|
@ -93,8 +93,6 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm)
|
||||||
#if HAVE_LLVM
|
#if HAVE_LLVM
|
||||||
if (try_llvm && draw_get_option_use_llvm()) {
|
if (try_llvm && draw_get_option_use_llvm()) {
|
||||||
draw->llvm = draw_llvm_create(draw);
|
draw->llvm = draw_llvm_create(draw);
|
||||||
if (!draw->llvm)
|
|
||||||
goto err_destroy;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -484,12 +484,13 @@ draw_llvm_create(struct draw_context *draw)
|
||||||
{
|
{
|
||||||
struct draw_llvm *llvm;
|
struct draw_llvm *llvm;
|
||||||
|
|
||||||
|
if (!lp_build_init())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
llvm = CALLOC_STRUCT( draw_llvm );
|
llvm = CALLOC_STRUCT( draw_llvm );
|
||||||
if (!llvm)
|
if (!llvm)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lp_build_init();
|
|
||||||
|
|
||||||
llvm->draw = draw;
|
llvm->draw = draw;
|
||||||
|
|
||||||
llvm->nr_variants = 0;
|
llvm->nr_variants = 0;
|
||||||
|
|
|
@ -306,7 +306,8 @@ init_gallivm_state(struct gallivm_state *gallivm, const char *name)
|
||||||
assert(!gallivm->context);
|
assert(!gallivm->context);
|
||||||
assert(!gallivm->module);
|
assert(!gallivm->module);
|
||||||
|
|
||||||
lp_build_init();
|
if (!lp_build_init())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (USE_GLOBAL_CONTEXT) {
|
if (USE_GLOBAL_CONTEXT) {
|
||||||
gallivm->context = LLVMGetGlobalContext();
|
gallivm->context = LLVMGetGlobalContext();
|
||||||
|
@ -382,11 +383,18 @@ fail:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
boolean
|
||||||
lp_build_init(void)
|
lp_build_init(void)
|
||||||
{
|
{
|
||||||
if (gallivm_initialized)
|
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
|
#ifdef DEBUG
|
||||||
gallivm_debug = debug_get_option_gallivm_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_avx = 0;
|
||||||
util_cpu_caps.has_f16c = 0;
|
util_cpu_caps.has_f16c = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ struct gallivm_state
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void
|
boolean
|
||||||
lp_build_init(void);
|
lp_build_init(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -231,10 +231,10 @@ lp_jit_screen_cleanup(struct llvmpipe_screen *screen)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
boolean
|
||||||
lp_jit_screen_init(struct llvmpipe_screen *screen)
|
lp_jit_screen_init(struct llvmpipe_screen *screen)
|
||||||
{
|
{
|
||||||
lp_build_init();
|
return lp_build_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -252,7 +252,7 @@ void
|
||||||
lp_jit_screen_cleanup(struct llvmpipe_screen *screen);
|
lp_jit_screen_cleanup(struct llvmpipe_screen *screen);
|
||||||
|
|
||||||
|
|
||||||
void
|
boolean
|
||||||
lp_jit_screen_init(struct llvmpipe_screen *screen);
|
lp_jit_screen_init(struct llvmpipe_screen *screen);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -557,6 +557,9 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!lp_jit_screen_init(screen))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
LP_DEBUG = debug_get_flags_option("LP_DEBUG", lp_debug_flags, 0 );
|
LP_DEBUG = debug_get_flags_option("LP_DEBUG", lp_debug_flags, 0 );
|
||||||
#endif
|
#endif
|
||||||
|
@ -588,8 +591,6 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
|
||||||
|
|
||||||
llvmpipe_init_screen_resource_funcs(&screen->base);
|
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;
|
screen->num_threads = util_cpu_caps.nr_cpus > 1 ? util_cpu_caps.nr_cpus : 0;
|
||||||
#ifdef PIPE_SUBSYSTEM_EMBEDDED
|
#ifdef PIPE_SUBSYSTEM_EMBEDDED
|
||||||
screen->num_threads = 0;
|
screen->num_threads = 0;
|
||||||
|
|
|
@ -376,6 +376,9 @@ int main(int argc, char **argv)
|
||||||
fpstate = util_fpstate_get();
|
fpstate = util_fpstate_get();
|
||||||
util_fpstate_set_denorms_to_zero(fpstate);
|
util_fpstate_set_denorms_to_zero(fpstate);
|
||||||
|
|
||||||
|
if (!lp_build_init())
|
||||||
|
return 1;
|
||||||
|
|
||||||
for(i = 1; i < argc; ++i) {
|
for(i = 1; i < argc; ++i) {
|
||||||
if(strcmp(argv[i], "-v") == 0)
|
if(strcmp(argv[i], "-v") == 0)
|
||||||
++verbose;
|
++verbose;
|
||||||
|
@ -387,8 +390,6 @@ int main(int argc, char **argv)
|
||||||
n = atoi(argv[i]);
|
n = atoi(argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
lp_build_init();
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (verbose >= 2) {
|
if (verbose >= 2) {
|
||||||
gallivm_debug |= GALLIVM_DEBUG_IR;
|
gallivm_debug |= GALLIVM_DEBUG_IR;
|
||||||
|
|
Loading…
Reference in New Issue