From fdbc45d1d46341b7efd596e5fb5ff9d242f649da Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Oct 2020 13:43:03 -0700 Subject: [PATCH] nir: Only validate in passes that might have changed things. If a pass returning boolean progress reports no change, we shouldn't need to re-validate. If a pass breaks the NIR but also fails to report progress correctly, it would be up to the next pass to catch that. This should hopefully help with test timeouts on KHR-GL33.texture_swizzle.functional since switching softpipe to nir-to-tgsi and enabling NIR validation in CI (27s to 20s on my system). Suggested-by: Rob Clark Reviewed-by: Rob Clark Reviewed-By: Mike Blumenkrantz Reviewed-by: Jason Ekstrand Part-of: --- src/compiler/nir/nir.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 106b6087928..1bae765fea4 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -4063,7 +4063,6 @@ static inline bool should_print_nir(nir_shader *shader) { return false; } break; \ } \ do_pass \ - nir_validate_shader(nir, "after " #pass); \ if (should_clone_nir()) { \ nir_shader *clone = nir_shader_clone(ralloc_parent(nir), nir); \ nir_shader_replace(nir, clone); \ @@ -4078,6 +4077,7 @@ static inline bool should_print_nir(nir_shader *shader) { return false; } if (should_print_nir(nir)) \ printf("%s\n", #pass); \ if (pass(nir, ##__VA_ARGS__)) { \ + nir_validate_shader(nir, "after " #pass); \ progress = true; \ if (should_print_nir(nir)) \ nir_print_shader(nir, stdout); \ @@ -4089,6 +4089,7 @@ static inline bool should_print_nir(nir_shader *shader) { return false; } if (should_print_nir(nir)) \ printf("%s\n", #pass); \ pass(nir, ##__VA_ARGS__); \ + nir_validate_shader(nir, "after " #pass); \ if (should_print_nir(nir)) \ nir_print_shader(nir, stdout); \ )