mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-20 15:20:38 +01:00
nir/opt_loop: Fix handling else-breaks in merge_terminators
If both breaks are in the else branch, we have to use iand. Fixes:9995f33("nir: add merge loop terminators optimisation") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11726 Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30850> (cherry picked from commit0fc3c52e43)
This commit is contained in:
parent
8390fe9932
commit
be036a778a
2 changed files with 8 additions and 2 deletions
|
|
@ -94,7 +94,7 @@
|
|||
"description": "nir/opt_loop: Fix handling else-breaks in merge_terminators",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "9995f336e60c2197236c7d815e8ab20ede18b781",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -557,7 +557,13 @@ merge_terminators(nir_builder *b, nir_if *dest_if, nir_if *src_if)
|
|||
}
|
||||
|
||||
b->cursor = nir_before_src(&dest_if->condition);
|
||||
nir_def *new_c = nir_ior(b, dest_if->condition.ssa, src_if->condition.ssa);
|
||||
|
||||
nir_def *new_c = NULL;
|
||||
if (then_break)
|
||||
new_c = nir_ior(b, dest_if->condition.ssa, src_if->condition.ssa);
|
||||
else
|
||||
new_c = nir_iand(b, dest_if->condition.ssa, src_if->condition.ssa);
|
||||
|
||||
nir_src_rewrite(&dest_if->condition, new_c);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue