aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard/compiler.h
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-27 14:26:27 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-30 15:50:24 -0700
commitbd79cddafad1894ec6f768b614bbc8f03db539f7 (patch)
treed79290771afbb3de29df5a0619a0e5ab51fcc293 /src/panfrost/midgard/compiler.h
parentf29d03a1f90a15d7b11e40af5ad41ccf93eb667f (diff)
pan/midgard: Add post-schedule iteration helpers
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/compiler.h')
-rw-r--r--src/panfrost/midgard/compiler.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index 084eddee5cb..e6b90e4aa48 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -363,6 +363,17 @@ mir_next_op(struct midgard_instruction *ins)
#define mir_foreach_bundle_in_block(block, v) \
util_dynarray_foreach(&block->bundles, midgard_bundle, v)
+#define mir_foreach_bundle_in_block_rev(block, v) \
+ util_dynarray_foreach_reverse(&block->bundles, midgard_bundle, v)
+
+#define mir_foreach_instr_in_block_scheduled_rev(block, v) \
+ midgard_instruction* v; \
+ signed i = 0; \
+ mir_foreach_bundle_in_block_rev(block, _bundle) \
+ for (i = (_bundle->instruction_count - 1), v = _bundle->instructions[i]; \
+ i >= 0; \
+ --i, v = _bundle->instructions[i]) \
+
#define mir_foreach_instr_global(ctx, v) \
mir_foreach_block(ctx, v_block) \
mir_foreach_instr_in_block(v_block, v)