Same as Frank's change to draw module but for llvmpipe module.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
variant->jit_function[RAST_WHOLE] = variant->jit_function[RAST_EDGE_TEST];
}
+ gallivm_free_ir(variant->gallivm);
+
return variant;
}
llvmpipe_remove_shader_variant(struct llvmpipe_context *lp,
struct lp_fragment_shader_variant *variant)
{
- unsigned i;
-
if (gallivm_debug & GALLIVM_DEBUG_IR) {
debug_printf("llvmpipe: del fs #%u var #%u v created #%u v cached"
" #%u v total cached #%u\n",
lp->nr_fs_variants);
}
- /* free all the variant's JIT'd functions */
- for (i = 0; i < Elements(variant->function); i++) {
- if (variant->function[i]) {
- gallivm_free_function(variant->gallivm,
- variant->function[i],
- variant->jit_function[i]);
- }
- }
-
gallivm_destroy(variant->gallivm);
/* remove from shader's list */
if (!variant->jit_function)
goto fail;
+ gallivm_free_ir(variant->gallivm);
+
/*
* Update timing information:
*/
fail:
if (variant) {
- if (variant->function) {
- gallivm_free_function(gallivm,
- variant->function,
- variant->jit_function);
- }
if (variant->gallivm) {
gallivm_destroy(variant->gallivm);
}
variant->no, lp->nr_setup_variants);
}
- if (variant->function) {
- gallivm_free_function(variant->gallivm,
- variant->function,
- variant->jit_function);
- }
-
if (variant->gallivm) {
gallivm_destroy(variant->gallivm);
}
test_func_jit = (unary_func_t) gallivm_jit_function(gallivm, test_func);
+ gallivm_free_ir(gallivm);
+
for (j = 0; j < (test->num_values + length - 1) / length; j++) {
int num_vals = ((j + 1) * length <= test->num_values) ? length :
test->num_values % length;
}
}
- gallivm_free_function(gallivm, test_func, test_func_jit);
-
gallivm_destroy(gallivm);
align_free(in);
blend_test_ptr = (blend_test_ptr_t)gallivm_jit_function(gallivm, func);
+ gallivm_free_ir(gallivm);
+
success = TRUE;
{
if(fp)
write_tsv_row(fp, blend, type, cycles_avg, success);
- gallivm_free_function(gallivm, func, blend_test_ptr);
-
gallivm_destroy(gallivm);
return success;
conv_test_ptr = (conv_test_ptr_t)gallivm_jit_function(gallivm, func);
+ gallivm_free_ir(gallivm);
+
success = TRUE;
for(i = 0; i < n && success; ++i) {
unsigned src_stride = src_type.length*src_type.width/8;
if(fp)
write_tsv_row(fp, src_type, dst_type, cycles_avg, success);
- gallivm_free_function(gallivm, func, conv_test_ptr);
-
gallivm_destroy(gallivm);
return success;
fetch_ptr = (fetch_ptr_t) gallivm_jit_function(gallivm, fetch);
+ gallivm_free_ir(gallivm);
+
for (l = 0; l < util_format_nr_test_cases; ++l) {
const struct util_format_test_case *test = &util_format_test_cases[l];
}
}
- gallivm_free_function(gallivm, fetch, fetch_ptr);
-
gallivm_destroy(gallivm);
if(fp)
fetch_ptr = (fetch_ptr_t) gallivm_jit_function(gallivm, fetch);
+ gallivm_free_ir(gallivm);
+
for (l = 0; l < util_format_nr_test_cases; ++l) {
const struct util_format_test_case *test = &util_format_test_cases[l];
}
}
- gallivm_free_function(gallivm, fetch, fetch_ptr);
-
gallivm_destroy(gallivm);
if(fp)
test_printf_func = (test_printf_t) gallivm_jit_function(gallivm, test);
- test_printf_func(0);
+ gallivm_free_ir(gallivm);
- gallivm_free_function(gallivm, test, test_printf_func);
+ test_printf_func(0);
gallivm_destroy(gallivm);