diff options
Diffstat (limited to 'src/panfrost/util/pan_ir.c')
-rw-r--r-- | src/panfrost/util/pan_ir.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/panfrost/util/pan_ir.c b/src/panfrost/util/pan_ir.c index 95f8e6b5326..fbe8f66bff4 100644 --- a/src/panfrost/util/pan_ir.c +++ b/src/panfrost/util/pan_ir.c @@ -70,3 +70,25 @@ pan_to_bytemask(unsigned bytes, unsigned mask) unreachable("Invalid register mode"); } } + +void +pan_block_add_successor(pan_block *block, pan_block *successor) +{ + assert(block); + assert(successor); + + for (unsigned i = 0; i < ARRAY_SIZE(block->successors); ++i) { + if (block->successors[i]) { + if (block->successors[i] == successor) + return; + else + continue; + } + + block->successors[i] = successor; + _mesa_set_add(successor->predecessors, block); + return; + } + + unreachable("Too many successors"); +} |