if (instr->flags & IR3_INSTR_UNUSED) {
if (instr->opc == OPC_META_SPLIT) {
struct ir3_instruction *src = ssa(instr->regs[1]);
- /* leave inputs alone.. we can't optimize out components of
- * an input, since the hw is still going to be writing all
- * of the components, and we could end up in a situation
- * where multiple inputs overlap.
+ /* tex (cat5) instructions have a writemask, so we can
+ * mask off unused components. Other instructions do not.
*/
- if ((src->opc != OPC_META_INPUT) &&
- (src->regs[0]->wrmask > 1)) {
+ if (is_tex(src) && (src->regs[0]->wrmask > 1)) {
src->regs[0]->wrmask &= ~(1 << instr->split.off);
/* prune no-longer needed right-neighbors. We could