pan/bi: Use nr_{srcs,dests} in bi_foreach_{src,dest}

This avoids crawling sources that must be null.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>
This commit is contained in:
Alyssa Rosenzweig 2022-07-21 12:57:57 -04:00 committed by Marge Bot
parent 9176182a1e
commit 63051b68d7

View file

@ -1026,10 +1026,10 @@ bi_node_to_index(unsigned node, unsigned node_count)
util_dynarray_foreach(&(blk)->predecessors, bi_block *, v)
#define bi_foreach_src(ins, v) \
for (unsigned v = 0; v < ARRAY_SIZE(ins->src); ++v)
for (unsigned v = 0; v < ins->nr_srcs; ++v)
#define bi_foreach_dest(ins, v) \
for (unsigned v = 0; v < ARRAY_SIZE(ins->dest); ++v)
for (unsigned v = 0; v < ins->nr_dests; ++v)
#define bi_foreach_instr_and_src_in_tuple(tuple, ins, s) \
bi_foreach_instr_in_tuple(tuple, ins) \