Trivial.
{
char test_name[128];
util_snprintf(test_name, sizeof test_name, "%s.v%u", test->name, length);
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef test_func;
unary_func_t test_func_jit;
in[i] = 1.0;
}
- gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module", context);
test_func = build_unary_test_func(gallivm, test, length, test_name);
}
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
align_free(in);
align_free(out);
const struct pipe_blend_state *blend,
struct lp_type type)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef func = NULL;
blend_test_ptr_t blend_test_ptr;
if(verbose >= 1)
dump_blend_type(stdout, blend, type);
- gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module", context);
func = add_blend_test(gallivm, blend, type);
write_tsv_row(fp, blend, type, cycles_avg, success);
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
return success;
}
struct lp_type src_type,
struct lp_type dst_type)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef func = NULL;
conv_test_ptr_t conv_test_ptr;
eps = MAX2(lp_const_eps(src_type), lp_const_eps(dst_type));
- gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module", context);
func = add_conv_test(gallivm, src_type, num_srcs, dst_type, num_dsts);
write_tsv_row(fp, src_type, dst_type, cycles_avg, success);
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
return success;
}
test_format_float(unsigned verbose, FILE *fp,
const struct util_format_description *desc)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef fetch = NULL;
fetch_ptr_t fetch_ptr;
boolean success = TRUE;
unsigned i, j, k, l;
- gallivm = gallivm_create("test_module_float", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module_float", context);
fetch = add_fetch_rgba_test(gallivm, verbose, desc, lp_float32_vec4_type());
}
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
if(fp)
write_tsv_row(fp, desc, success);
test_format_unorm8(unsigned verbose, FILE *fp,
const struct util_format_description *desc)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef fetch = NULL;
fetch_ptr_t fetch_ptr;
boolean success = TRUE;
unsigned i, j, k, l;
- gallivm = gallivm_create("test_module_unorm8", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module_unorm8", context);
fetch = add_fetch_rgba_test(gallivm, verbose, desc, lp_unorm8_vec4_type());
}
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
if(fp)
write_tsv_row(fp, desc, success);
test_printf(unsigned verbose, FILE *fp,
const struct printf_test_case *testcase)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef test;
test_printf_t test_printf_func;
boolean success = TRUE;
- gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module", context);
test = add_printf_test(gallivm);
test_printf_func(0);
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
return success;
}