agx: expand macro
nfc Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31532>
This commit is contained in:
committed by
Marge Bot
parent
372580086e
commit
bef3655d06
@@ -502,40 +502,42 @@ agx_optimizer_backward(agx_context *ctx)
|
||||
agx_instr **uses = calloc(ctx->alloc, sizeof(*uses));
|
||||
BITSET_WORD *multiple = calloc(BITSET_WORDS(ctx->alloc), sizeof(*multiple));
|
||||
|
||||
agx_foreach_instr_global_rev(ctx, I) {
|
||||
struct agx_opcode_info info = agx_opcodes_info[I->op];
|
||||
agx_foreach_block_rev(ctx, block) {
|
||||
agx_foreach_instr_in_block_rev(block, I) {
|
||||
struct agx_opcode_info info = agx_opcodes_info[I->op];
|
||||
|
||||
agx_foreach_ssa_src(I, s) {
|
||||
if (I->src[s].type == AGX_INDEX_NORMAL) {
|
||||
unsigned v = I->src[s].value;
|
||||
agx_foreach_ssa_src(I, s) {
|
||||
if (I->src[s].type == AGX_INDEX_NORMAL) {
|
||||
unsigned v = I->src[s].value;
|
||||
|
||||
if (uses[v])
|
||||
BITSET_SET(multiple, v);
|
||||
else
|
||||
uses[v] = I;
|
||||
if (uses[v])
|
||||
BITSET_SET(multiple, v);
|
||||
else
|
||||
uses[v] = I;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (info.nr_dests != 1)
|
||||
continue;
|
||||
if (info.nr_dests != 1)
|
||||
continue;
|
||||
|
||||
if (I->dest[0].type != AGX_INDEX_NORMAL)
|
||||
continue;
|
||||
if (I->dest[0].type != AGX_INDEX_NORMAL)
|
||||
continue;
|
||||
|
||||
agx_instr *use = uses[I->dest[0].value];
|
||||
agx_instr *use = uses[I->dest[0].value];
|
||||
|
||||
if (!use || BITSET_TEST(multiple, I->dest[0].value))
|
||||
continue;
|
||||
if (!use || BITSET_TEST(multiple, I->dest[0].value))
|
||||
continue;
|
||||
|
||||
if (agx_optimizer_not(I, use)) {
|
||||
agx_remove_instruction(use);
|
||||
continue;
|
||||
}
|
||||
if (agx_optimizer_not(I, use)) {
|
||||
agx_remove_instruction(use);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Destination has a single use, try to propagate */
|
||||
if (info.is_float && agx_optimizer_fmov_rev(I, use)) {
|
||||
agx_remove_instruction(use);
|
||||
continue;
|
||||
/* Destination has a single use, try to propagate */
|
||||
if (info.is_float && agx_optimizer_fmov_rev(I, use)) {
|
||||
agx_remove_instruction(use);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user