From 01b0935d315347cfd06bb5d8bb1a6b59913f94cc Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 19 Jul 2021 19:33:12 +0300 Subject: [PATCH] nir/lower_shader_calls: remove empty phis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is confusing opt_cse. Signed-off-by: Lionel Landwerlin Fixes: 8dfb240b1f0633 ("nir: Add raytracing shader call lowering pass.") Reviewed-by: Daniel Schürmann Part-of: --- src/compiler/nir/nir_lower_shader_calls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/nir_lower_shader_calls.c b/src/compiler/nir/nir_lower_shader_calls.c index e1398bf25ae..40e8d621b97 100644 --- a/src/compiler/nir/nir_lower_shader_calls.c +++ b/src/compiler/nir/nir_lower_shader_calls.c @@ -1108,6 +1108,8 @@ nir_lower_shader_calls(nir_shader *shader, NIR_PASS_V(shader, spill_ssa_defs_and_lower_shader_calls, num_calls, address_format, stack_alignment); + nir_opt_remove_phis(shader); + /* Make N copies of our shader */ nir_shader **resume_shaders = ralloc_array(mem_ctx, nir_shader *, num_calls); for (unsigned i = 0; i < num_calls; i++) @@ -1117,6 +1119,7 @@ nir_lower_shader_calls(nir_shader *shader, for (unsigned i = 0; i < num_calls; i++) { nir_instr *resume_instr = lower_resume(resume_shaders[i], i); replace_resume_with_halt(resume_shaders[i], resume_instr); + nir_opt_remove_phis(resume_shaders[i]); } *resume_shaders_out = resume_shaders;