From: Rob Clark Date: Fri, 19 Jan 2018 21:13:09 +0000 (-0500) Subject: freedreno/ir3: use peephole select pass X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec8bc54ad2ce4e05ff8e3679672a616b1984be80;p=mesa.git freedreno/ir3: use peephole select pass Agressively lowering all if/else to selects in some extreme cases results in much higher register pressure. Using peephole select instead with a modest threshold speeds up alu2 4x! 16 seems like a good limit, low enough to help alu2 but not too low that it penalizes everything else. With a bit better scheduling of the instruction that moves a value into a predicate register, we might be able to lower this limit a bit more in the future, but since we need 6 cycles from the move to predicate register to predicated branch, that puts some sort of lower bound on how far we can lower this threshold. Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_nir.c index 81a46be914e..e76b39b2304 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_nir.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.c @@ -97,7 +97,7 @@ ir3_optimize_loop(nir_shader *s) progress |= OPT(s, nir_copy_prop); progress |= OPT(s, nir_opt_dce); progress |= OPT(s, nir_opt_cse); - progress |= OPT(s, ir3_nir_lower_if_else); + progress |= OPT(s, nir_opt_peephole_select, 16); progress |= OPT(s, nir_opt_algebraic); progress |= OPT(s, nir_opt_constant_folding);