summaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-15 08:48:34 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-19 08:32:17 -0700
commitc8c4471a92408f48c47d0bcdbe87c9acfcca3376 (patch)
tree62c641a6a36d9b520202762051c873fe3a9b9b16 /src/panfrost
parentb8e526c520a20b13492e0ca5074d72f5b3f6388f (diff)
pan/midgard: Add mir_foreach_successor helper
Now we should be able to walk the control-flow graph naturally. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/midgard/compiler.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index f196389c36a..a78d933e9e4 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -360,6 +360,14 @@ mir_next_op(struct midgard_instruction *ins)
mir_foreach_block(ctx, v_block) \
mir_foreach_instr_in_block_safe(v_block, v)
+#define mir_foreach_successor(blk, v) \
+ struct midgard_block *v; \
+ struct midgard_block **_v; \
+ for (_v = &blk->successors[0], \
+ v = *_v; \
+ v != NULL && _v < &blk->successors[2]; \
+ _v++, v = *_v) \
+
/* Based on set_foreach, expanded with automatic type casts */
#define mir_foreach_predecessor(blk, v) \