agx: add foreach_reg_{src,dest}

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36399>
This commit is contained in:
Alyssa Rosenzweig 2025-07-31 08:35:14 -04:00
parent 700a88233b
commit fc9f3363fa
2 changed files with 10 additions and 0 deletions

View file

@ -229,6 +229,8 @@ ForEachMacros:
- agx_foreach_ssa_dest_rev
- agx_foreach_ssa_src
- agx_foreach_ssa_src_rev
- agx_foreach_reg_src
- agx_foreach_reg_dest
- agx_foreach_successor
- foreach_next_use
- libagx_foreach_xfb

View file

@ -728,6 +728,10 @@ void agx_block_add_successor(agx_block *block, agx_block *successor);
agx_foreach_src_rev(ins, v) \
if (ins->src[v].type == AGX_INDEX_NORMAL)
#define agx_foreach_reg_src(ins, v) \
agx_foreach_src(ins, v) \
if (ins->src[v].type == AGX_INDEX_REGISTER)
#define agx_foreach_ssa_dest(ins, v) \
agx_foreach_dest(ins, v) \
if (ins->dest[v].type == AGX_INDEX_NORMAL)
@ -736,6 +740,10 @@ void agx_block_add_successor(agx_block *block, agx_block *successor);
agx_foreach_dest_rev(ins, v) \
if (ins->dest[v].type == AGX_INDEX_NORMAL)
#define agx_foreach_reg_dest(ins, v) \
agx_foreach_dest(ins, v) \
if (ins->dest[v].type == AGX_INDEX_REGISTER)
/* Phis only come at the start (after else instructions) so we stop as soon as
* we hit a non-phi
*/