These can be created when removing unreachable control flow, and it
seems easier to remove them than to add special code to handle them when
spilling.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
if (!is_same_type_reg(instr->dsts[0], instr->srcs[0]))
return false;
break;
+ case OPC_META_PHI:
+ return instr->srcs_count == 1;
default:
return false;
}
/* TODO non-indirect access we could figure out which register
* we actually want and allow cp..
*/
- if (reg->flags & IR3_REG_ARRAY)
+ if ((reg->flags & IR3_REG_ARRAY) && src->opc != OPC_META_PHI)
continue;
/* Don't CP absneg into meta instructions, that won't end well: */
- if (is_meta(instr) && (src->opc != OPC_MOV))
+ if (is_meta(instr) &&
+ (src->opc == OPC_ABSNEG_F || src->opc == OPC_ABSNEG_S))
continue;
/* Don't CP mova and mova1 into their users */