mirror of https://gitlab.freedesktop.org/mesa/mesa
ir3/cp: Support swapping mad srcs for shared regs
This was missed when adding shared reg constraints, and helps with eliminating extra moves caused by uniform (but not const) mad sources. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22075>
This commit is contained in:
parent
ef75ea18cd
commit
0f62203edf
|
@ -280,7 +280,7 @@ try_swap_mad_two_srcs(struct ir3_instruction *instr, unsigned new_flags)
|
||||||
/* If the reason we couldn't fold without swapping is something
|
/* If the reason we couldn't fold without swapping is something
|
||||||
* other than const source, then swapping won't help:
|
* other than const source, then swapping won't help:
|
||||||
*/
|
*/
|
||||||
if (!(new_flags & IR3_REG_CONST))
|
if (!(new_flags & (IR3_REG_CONST | IR3_REG_SHARED)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
instr->cat3.swapped = true;
|
instr->cat3.swapped = true;
|
||||||
|
@ -338,6 +338,8 @@ reg_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr,
|
||||||
unuse(src);
|
unuse(src);
|
||||||
reg->def->instr->use_count++;
|
reg->def->instr->use_count++;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else if (n == 1 && try_swap_mad_two_srcs(instr, new_flags)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if ((is_same_type_mov(src) || is_const_mov(src)) &&
|
} else if ((is_same_type_mov(src) || is_const_mov(src)) &&
|
||||||
|
|
Loading…
Reference in New Issue