mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-22 14:00:37 +02:00
nir/copy_propagate: do not copy-propagate MOV srcs with source modifiers
If a source operand in a MOV has source modifiers, then we cannot
copy-propagate it from the parent instruction and remove the MOV.
v2: remove the check for source modifiers from is_move() (Jason)
v3: Put the check for source modifiers back into is_move() since
this function is called from copy_prop_alu_src(). Add source
modifiers checks to is_vec() instead.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
parent
ff17b3ccf4
commit
3f34afa0aa
1 changed files with 6 additions and 1 deletions
|
|
@ -55,10 +55,15 @@ static bool is_move(nir_alu_instr *instr)
|
|||
|
||||
static bool is_vec(nir_alu_instr *instr)
|
||||
{
|
||||
for (unsigned i = 0; i < nir_op_infos[instr->op].num_inputs; i++)
|
||||
for (unsigned i = 0; i < nir_op_infos[instr->op].num_inputs; i++) {
|
||||
if (!instr->src[i].src.is_ssa)
|
||||
return false;
|
||||
|
||||
/* we handle modifiers in a separate pass */
|
||||
if (instr->src[i].abs || instr->src[i].negate)
|
||||
return false;
|
||||
}
|
||||
|
||||
return instr->op == nir_op_vec2 ||
|
||||
instr->op == nir_op_vec3 ||
|
||||
instr->op == nir_op_vec4;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue