summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErico Nunes <[email protected]>2019-08-04 23:43:44 +0200
committerErico Nunes <[email protected]>2019-08-05 23:36:35 +0200
commit9e8f8dbcd1ceea94d74d74a6b45cad146a699b1f (patch)
treee7d6ef957bd3b626316537ecc43c42f57c26dd93
parent3db49491978a72eaea8b4735f0ba805dbc87b7d7 (diff)
lima: re-run nir_opt_algebraic after int lowering
nir_lower_int_to_float is currently only meant to run once, and some ops must be lowered after being converted from int ops to be implementable, so re-run nir_opt_algebraic after lowering ints to floats. Signed-off-by: Erico Nunes <[email protected]> Reviewed-by: Vasily Khoruzhick <[email protected]>
-rw-r--r--src/gallium/drivers/lima/lima_program.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/lima/lima_program.c b/src/gallium/drivers/lima/lima_program.c
index 13fd31166ae..66962e5ce23 100644
--- a/src/gallium/drivers/lima/lima_program.c
+++ b/src/gallium/drivers/lima/lima_program.c
@@ -128,6 +128,14 @@ lima_program_optimize_vs_nir(struct nir_shader *s)
NIR_PASS_V(s, nir_lower_int_to_float);
NIR_PASS_V(s, nir_lower_bool_to_float);
+
+ /* Some ops must be lowered after being converted from int ops,
+ * so re-run nir_opt_algebraic after int lowering. */
+ do {
+ progress = false;
+ NIR_PASS(progress, s, nir_opt_algebraic);
+ } while (progress);
+
NIR_PASS_V(s, nir_copy_prop);
NIR_PASS_V(s, nir_opt_dce);
NIR_PASS_V(s, nir_lower_locals_to_regs);
@@ -179,6 +187,13 @@ lima_program_optimize_fs_nir(struct nir_shader *s)
NIR_PASS_V(s, nir_lower_int_to_float);
NIR_PASS_V(s, nir_lower_bool_to_float);
+ /* Some ops must be lowered after being converted from int ops,
+ * so re-run nir_opt_algebraic after int lowering. */
+ do {
+ progress = false;
+ NIR_PASS(progress, s, nir_opt_algebraic);
+ } while (progress);
+
/* Lower modifiers */
NIR_PASS_V(s, nir_lower_to_source_mods, nir_lower_all_source_mods);
NIR_PASS_V(s, nir_copy_prop);