Written in a funny way but easy to convince yourself of correctness by
considering cases.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8723>
bi_foreach_block(ctx, v_block) \
bi_foreach_instr_in_block_safe((bi_block *) v_block, v)
+#define bi_foreach_instr_in_tuple(tuple, v) \
+ for (bi_instr *v = tuple->fma ?: tuple->add; \
+ v != NULL; \
+ v = (v == tuple->add) ? NULL : tuple->add)
+
/* Based on set_foreach, expanded with automatic type casts */
#define bi_foreach_predecessor(blk, v) \