From 73dcdc7a4ea2bb39a69ec0cf6855d23d5c2ad449 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 19 Jan 2024 19:38:23 +0000 Subject: [PATCH] nir/lower_shader_calls: remove CF before nir_opt_if Otherwise, opt_if_simplification() can attempt to insert an inot after a jump. Fixes RADV compilation of a Cyberpunk 2077 pipeline with PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT. Signed-off-by: Rhys Perry Reviewed-by: Lionel Landwerlin Cc: mesa-stable Part-of: (cherry picked from commit e465ac25618b3ce2d8666b5015101414f05f9876) --- .pick_status.json | 2 +- src/compiler/nir/nir_lower_shader_calls.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 6bdfe73b302..6b14b95e275 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -274,7 +274,7 @@ "description": "nir/lower_shader_calls: remove CF before nir_opt_if", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/compiler/nir/nir_lower_shader_calls.c b/src/compiler/nir/nir_lower_shader_calls.c index d9e2a33966c..624ede07a9f 100644 --- a/src/compiler/nir/nir_lower_shader_calls.c +++ b/src/compiler/nir/nir_lower_shader_calls.c @@ -2050,6 +2050,8 @@ 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); + /* Remove CF after halt before nir_opt_if(). */ + nir_opt_dead_cf(resume_shaders[i]); /* Remove the dummy blocks added by flatten_resume_if_ladder() */ nir_opt_if(resume_shaders[i], nir_opt_if_optimize_phi_true_false); nir_opt_dce(resume_shaders[i]);