mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-16 04:38:30 +02:00
nir/spirv/cfg: Detect switch_break after loop_break/continue
While the current CFG code is valid in the case where a switch break also
happens to be a loop continue, it's a bit suboptimal. Since hardware is
capable of handling the continue as a direct jump, it's better to use a
continue instruction when we can than to bother with all of the nasty
switch break lowering.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ef3c5ac7fb)
This commit is contained in:
parent
12d09e24f8
commit
5e4aeeb8ec
1 changed files with 2 additions and 2 deletions
|
|
@ -239,12 +239,12 @@ vtn_get_branch_type(struct vtn_block *block,
|
|||
swcase->fallthrough == block->switch_case);
|
||||
swcase->fallthrough = block->switch_case;
|
||||
return vtn_branch_type_switch_fallthrough;
|
||||
} else if (block == switch_break) {
|
||||
return vtn_branch_type_switch_break;
|
||||
} else if (block == loop_break) {
|
||||
return vtn_branch_type_loop_break;
|
||||
} else if (block == loop_cont) {
|
||||
return vtn_branch_type_loop_continue;
|
||||
} else if (block == switch_break) {
|
||||
return vtn_branch_type_switch_break;
|
||||
} else {
|
||||
return vtn_branch_type_none;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue