nir/opt_dead_cf: Remove if branches with undef condition.

Treat them as if the undef were false.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24792>
This commit is contained in:
Timur Kristóf
2023-04-20 12:35:01 +02:00
committed by Marek Olšák
parent 558e36f641
commit 8780f66c3a

View File

@@ -285,6 +285,9 @@ dead_cf_block(nir_block *block)
if (nir_src_is_const(following_if->condition)) {
opt_constant_if(following_if, nir_src_as_bool(following_if->condition));
return true;
} else if (nir_src_is_undef(following_if->condition)) {
opt_constant_if(following_if, false);
return true;
}
if (node_is_dead(&following_if->cf_node)) {