pan/bi: Use nr_{srcs,dests} in bi_foreach_{src,dest}
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 21 Jul 2022 16:57:57 +0000 (12:57 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Sep 2022 16:03:23 +0000 (16:03 +0000)
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>

src/panfrost/bifrost/compiler.h

index 9e34db0..ceb7e9d 100644 (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) \