From 63051b68d7bb41eb7bda52eb7595027d9ed23952 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 21 Jul 2022 12:57:57 -0400 Subject: [PATCH] pan/bi: Use nr_{srcs,dests} in bi_foreach_{src,dest} This avoids crawling sources that must be null. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/compiler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 9e34db0..ceb7e9d 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -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) \ -- 2.7.4