agx: Add loop header? flag

This is useful for deciding whether we need to fix up phis in RA.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23832>
This commit is contained in:
Alyssa Rosenzweig
2023-05-15 17:17:05 -04:00
committed by Marge Bot
parent a2dbe6b688
commit 923b966775
2 changed files with 6 additions and 0 deletions

View File

@@ -1738,6 +1738,7 @@ emit_loop(agx_context *ctx, nir_loop *nloop)
/* Emit the body */ /* Emit the body */
ctx->after_block = ctx->continue_block; ctx->after_block = ctx->continue_block;
ctx->after_block->loop_header = true;
agx_block *start_block = emit_cf_list(ctx, &nloop->body); agx_block *start_block = emit_cf_list(ctx, &nloop->body);
/* Fix up the nesting counter via an always true while_icmp, and branch back /* Fix up the nesting counter via an always true while_icmp, and branch back

View File

@@ -358,6 +358,11 @@ typedef struct agx_block {
/* Register allocation */ /* Register allocation */
BITSET_DECLARE(regs_out, AGX_NUM_REGS); BITSET_DECLARE(regs_out, AGX_NUM_REGS);
/* Is this block a loop header? If not, all of its predecessors precede it in
* source order.
*/
bool loop_header;
/* Offset of the block in the emitted binary */ /* Offset of the block in the emitted binary */
off_t offset; off_t offset;