Revert "nir/copy_propagate: do not copy-propagate MOV srcs with source modifiers"
The change proposed in the review leads to piglit regressions because is_move() is used in other places and relies on the checks for source modifiers to be there. Revert this until we agree on a better solution.
This commit is contained in:
@@ -41,6 +41,11 @@ static bool is_move(nir_alu_instr *instr)
|
|||||||
if (instr->dest.saturate)
|
if (instr->dest.saturate)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* we handle modifiers in a separate pass */
|
||||||
|
|
||||||
|
if (instr->src[0].abs || instr->src[0].negate)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!instr->src[0].src.is_ssa)
|
if (!instr->src[0].src.is_ssa)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -60,13 +65,9 @@ static bool is_vec(nir_alu_instr *instr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
is_simple_move(nir_alu_instr *instr)
|
is_swizzleless_move(nir_alu_instr *instr)
|
||||||
{
|
{
|
||||||
if (is_move(instr)) {
|
if (is_move(instr)) {
|
||||||
/* We handle modifiers in a separate pass */
|
|
||||||
if (instr->src[0].negate || instr->src[0].abs)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < 4; i++) {
|
for (unsigned i = 0; i < 4; i++) {
|
||||||
if (!((instr->dest.write_mask >> i) & 1))
|
if (!((instr->dest.write_mask >> i) & 1))
|
||||||
break;
|
break;
|
||||||
@@ -80,10 +81,6 @@ is_simple_move(nir_alu_instr *instr)
|
|||||||
if (instr->src[i].swizzle[0] != i)
|
if (instr->src[i].swizzle[0] != i)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* We handle modifiers in a separate pass */
|
|
||||||
if (instr->src[i].negate || instr->src[i].abs)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (def == NULL) {
|
if (def == NULL) {
|
||||||
def = instr->src[i].src.ssa;
|
def = instr->src[i].src.ssa;
|
||||||
} else if (instr->src[i].src.ssa != def) {
|
} else if (instr->src[i].src.ssa != def) {
|
||||||
@@ -110,7 +107,7 @@ copy_prop_src(nir_src *src, nir_instr *parent_instr, nir_if *parent_if)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
nir_alu_instr *alu_instr = nir_instr_as_alu(src_instr);
|
nir_alu_instr *alu_instr = nir_instr_as_alu(src_instr);
|
||||||
if (!is_simple_move(alu_instr))
|
if (!is_swizzleless_move(alu_instr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Don't let copy propagation land us with a phi that has more
|
/* Don't let copy propagation land us with a phi that has more
|
||||||
|
Reference in New Issue
Block a user