From 73262d4bd4a4637a332264a165c62ce3209d03fb Mon Sep 17 00:00:00 2001 From: Enrico Galli Date: Fri, 23 Jul 2021 14:47:33 -0700 Subject: [PATCH] microsoft/spirv_to_dxil: Adding continue opt pass to fix DXIL loop gen Reviewed-by: Jesse Natalie Part-of: --- src/microsoft/spirv_to_dxil/spirv_to_dxil.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/microsoft/spirv_to_dxil/spirv_to_dxil.c b/src/microsoft/spirv_to_dxil/spirv_to_dxil.c index 21eddda..f010007 100644 --- a/src/microsoft/spirv_to_dxil/spirv_to_dxil.c +++ b/src/microsoft/spirv_to_dxil/spirv_to_dxil.c @@ -125,6 +125,11 @@ spirv_to_dxil(const uint32_t *words, size_t word_count, NIR_PASS(progress, nir, nir_opt_undef); NIR_PASS(progress, nir, nir_opt_constant_folding); NIR_PASS(progress, nir, nir_opt_cse); + if (nir_opt_trivial_continues(nir)) { + progress = true; + NIR_PASS(progress, nir, nir_copy_prop); + NIR_PASS(progress, nir, nir_opt_dce); + } NIR_PASS(progress, nir, nir_lower_vars_to_ssa); NIR_PASS(progress, nir, nir_opt_algebraic); } while (progress); -- 2.7.4