ir3/cse: add support for mov a0.x/a1.x
Signed-off-by: Job Noorman <jnoorman@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32454>
This commit is contained in:
@@ -24,6 +24,7 @@ hash_instr(const void *data)
|
||||
|
||||
hash = HASH(hash, instr->opc);
|
||||
hash = HASH(hash, instr->dsts[0]->flags);
|
||||
hash = HASH(hash, instr->dsts[0]->num);
|
||||
foreach_src (src, (struct ir3_instruction *)instr) {
|
||||
if (src->flags & IR3_REG_CONST) {
|
||||
if (src->flags & IR3_REG_RELATIV)
|
||||
@@ -63,6 +64,9 @@ instrs_equal(const struct ir3_instruction *i1, const struct ir3_instruction *i2)
|
||||
if (i1->dsts[0]->flags != i2->dsts[0]->flags)
|
||||
return false;
|
||||
|
||||
if (i1->dsts[0]->num != i2->dsts[0]->num)
|
||||
return false;
|
||||
|
||||
for (unsigned i = 0; i < i1->srcs_count; i++) {
|
||||
const struct ir3_register *i1_reg = i1->srcs[i], *i2_reg = i2->srcs[i];
|
||||
|
||||
@@ -106,6 +110,9 @@ instr_can_cse(const struct ir3_instruction *instr)
|
||||
if (instr->opc != OPC_META_COLLECT && instr->opc != OPC_MOV)
|
||||
return false;
|
||||
|
||||
if (reg_num(instr->dsts[0]) == REG_A0)
|
||||
return true;
|
||||
|
||||
if (!is_dest_gpr(instr->dsts[0]) || (instr->dsts[0]->flags & IR3_REG_ARRAY))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user