mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
nir: Rework nir_scalar_chase_movs a bit
The cases in the if are the same as the cases we're using for the early break. Just check the things and break if it's not a handleable case. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24704>
This commit is contained in:
parent
cf796aa885
commit
87004fa701
1 changed files with 3 additions and 5 deletions
|
|
@ -2719,16 +2719,14 @@ nir_scalar_chase_movs(nir_scalar s)
|
|||
{
|
||||
while (nir_scalar_is_alu(s)) {
|
||||
nir_alu_instr *alu = nir_instr_as_alu(s.def->parent_instr);
|
||||
if (!nir_alu_instr_is_copy(alu))
|
||||
break;
|
||||
|
||||
if (alu->op == nir_op_mov) {
|
||||
s.def = alu->src[0].src.ssa;
|
||||
s.comp = alu->src[0].swizzle[s.comp];
|
||||
} else {
|
||||
assert(nir_op_is_vec(alu->op));
|
||||
} else if (nir_op_is_vec(alu->op)) {
|
||||
s.def = alu->src[s.comp].src.ssa;
|
||||
s.comp = alu->src[s.comp].swizzle[0];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue