static bool use_mcjit = FALSE;
#endif
+unsigned gallivm_perf = 0;
+
+static const struct debug_named_value lp_bld_perf_flags[] = {
+ { "no_brilinear", GALLIVM_PERF_NO_BRILINEAR, "disable brilinear optimization" },
+ { "no_rho_approx", GALLIVM_PERF_NO_RHO_APPROX, "disable rho_approx optimization" },
+ { "no_quad_lod", GALLIVM_PERF_NO_QUAD_LOD, "disable quad_lod optimization" },
+ { "nopt", GALLIVM_PERF_NO_OPT, "disable optimization passes to speed up shader compilation" },
+ { "no_filter_hacks", GALLIVM_PERF_NO_BRILINEAR | GALLIVM_PERF_NO_RHO_APPROX |
+ GALLIVM_PERF_NO_QUAD_LOD, "disable filter optimization hacks" },
+ DEBUG_NAMED_VALUE_END
+};
#ifdef DEBUG
unsigned gallivm_debug = 0;
{ "tgsi", GALLIVM_DEBUG_TGSI, NULL },
{ "ir", GALLIVM_DEBUG_IR, NULL },
{ "asm", GALLIVM_DEBUG_ASM, NULL },
- { "nopt", GALLIVM_DEBUG_NO_OPT, NULL },
{ "perf", GALLIVM_DEBUG_PERF, NULL },
- { "no_brilinear", GALLIVM_DEBUG_NO_BRILINEAR, NULL },
- { "no_rho_approx", GALLIVM_DEBUG_NO_RHO_APPROX, NULL },
- { "no_quad_lod", GALLIVM_DEBUG_NO_QUAD_LOD, NULL },
{ "gc", GALLIVM_DEBUG_GC, NULL },
{ "dumpbc", GALLIVM_DEBUG_DUMP_BC, NULL },
DEBUG_NAMED_VALUE_END
free(td_str);
}
- if ((gallivm_debug & GALLIVM_DEBUG_NO_OPT) == 0) {
+ if ((gallivm_perf & GALLIVM_PERF_NO_OPT) == 0) {
/*
* TODO: Evaluate passes some more - keeping in mind
* both quality of generated code and compile times.
char *error = NULL;
int ret;
- if (gallivm_debug & GALLIVM_DEBUG_NO_OPT) {
+ if (gallivm_perf & GALLIVM_PERF_NO_OPT) {
optlevel = None;
}
else {
gallivm_debug = debug_get_option_gallivm_debug();
#endif
+ gallivm_perf = debug_get_flags_option("GALLIVM_PERF", lp_bld_perf_flags, 0 );
+
lp_set_target_options();
util_cpu_detect();
LLVMWriteBitcodeToFile(gallivm->module, filename);
debug_printf("%s written\n", filename);
debug_printf("Invoke as \"opt %s %s | llc -O%d %s%s\"\n",
- gallivm_debug & GALLIVM_DEBUG_NO_OPT ? "-mem2reg" :
+ gallivm_debug & GALLIVM_PERF_NO_OPT ? "-mem2reg" :
"-sroa -early-cse -simplifycfg -reassociate "
"-mem2reg -constprop -instcombine -gvn",
- filename, gallivm_debug & GALLIVM_DEBUG_NO_OPT ? 0 : 2,
+ filename, gallivm_debug & GALLIVM_PERF_NO_OPT ? 0 : 2,
(HAVE_LLVM >= 0x0305) ? "[-mcpu=<-mcpu option>] " : "",
"[-mattr=<-mattr option(s)>]");
}