vc4: Optimize out silly SUBs of 0.

Drops instructions on vs-temp-array-mat4-index-col-row-wr.shader_test,
which I was looking at because it's failing to register allocate.
This commit is contained in:
Eric Anholt
2014-09-24 21:57:06 -07:00
parent 64122b16ce
commit 76cd9955d9
@@ -117,6 +117,17 @@ qir_opt_algebraic(struct vc4_compile *c)
}
break;
case QOP_FSUB:
case QOP_SUB:
if (is_zero(c, defs, inst->src[1])) {
dump_from(c, inst);
inst->op = QOP_MOV;
inst->src[1] = c->undef;
progress = true;
dump_to(c, inst);
}
break;
default:
break;
}