agx: Don't choke on registers in the optimizer

Just skip over them.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751>
This commit is contained in:
Alyssa Rosenzweig
2021-07-06 22:16:20 -04:00
committed by Marge Bot
parent 997e5cf440
commit f03cecf05f
2 changed files with 7 additions and 3 deletions
+2
View File
@@ -37,6 +37,8 @@ agx_dce(agx_context *ctx)
agx_foreach_dest(I, d) {
if (I->dest[d].type == AGX_INDEX_NORMAL)
needed |= BITSET_TEST(seen, I->dest[d].value);
else if (I->dest[d].type != AGX_INDEX_NULL)
needed = true;
}
if (!needed) {
+5 -3
View File
@@ -160,8 +160,8 @@ agx_optimizer_forward(agx_context *ctx)
struct agx_opcode_info info = agx_opcodes_info[I->op];
for (unsigned d = 0; d < info.nr_dests; ++d) {
assert(I->dest[d].type == AGX_INDEX_NORMAL);
defs[I->dest[d].value] = I;
if (I->dest[d].type == AGX_INDEX_NORMAL)
defs[I->dest[d].value] = I;
}
/* Propagate fmov down */
@@ -199,7 +199,9 @@ agx_optimizer_backward(agx_context *ctx)
if (info.nr_dests != 1)
continue;
assert(I->dest[0].type == AGX_INDEX_NORMAL);
if (I->dest[0].type != AGX_INDEX_NORMAL)
continue;
agx_instr *use = uses[I->dest[0].value];
if (!use || BITSET_TEST(multiple, I->dest[0].value))