diff options
author | Connor Abbott <[email protected]> | 2016-04-12 14:46:03 -0400 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-04-28 15:52:17 -0700 |
commit | 1a8c17a59e953e31de1c2f5b07d096a7e271e12f (patch) | |
tree | 79eb70842714cf7d3badf080f06a0eb857dd2296 | |
parent | 52affdd2e6f530b43abafcc56867510cc790e3e2 (diff) |
nir/opt_undef: fixup for new foreach_block()
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/compiler/nir/nir_opt_undef.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c index 38208f8476f..87c23b3c63f 100644 --- a/src/compiler/nir/nir_opt_undef.c +++ b/src/compiler/nir/nir_opt_undef.c @@ -71,20 +71,6 @@ opt_undef_alu(nir_alu_instr *instr) return false; } -static bool -opt_undef_block(nir_block *block, void *data) -{ - bool *progress = data; - - nir_foreach_instr_safe(block, instr) { - if (instr->type == nir_instr_type_alu) - if (opt_undef_alu(nir_instr_as_alu(instr))) - (*progress) = true; - } - - return true; -} - bool nir_opt_undef(nir_shader *shader) { @@ -92,7 +78,14 @@ nir_opt_undef(nir_shader *shader) nir_foreach_function(shader, function) { if (function->impl) { - nir_foreach_block_call(function->impl, opt_undef_block, &progress); + nir_foreach_block(block, function->impl) { + nir_foreach_instr_safe(block, instr) { + if (instr->type == nir_instr_type_alu) + if (opt_undef_alu(nir_instr_as_alu(instr))) + progress = true; + } + } + if (progress) nir_metadata_preserve(function->impl, nir_metadata_block_index | |