diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-04-21 19:12:10 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-04-24 02:22:31 +0000 |
commit | 879ff866b68e0de0c56d5211b94b75cf443eda1f (patch) | |
tree | 7562c120304b8ad9dfa85b0734e74b61b8412954 | |
parent | 521ac6e5b1c58f76076a6a2973b8a44a07cedbc9 (diff) |
panfrost/midgard: Fix off-by-one in successor analysis
This reduces register pressure substantially since we get smaller
liveness ranges.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard_compile.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index 444d5a32dd2..fcc17a5a092 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -3402,8 +3402,10 @@ emit_loop(struct compiler_context *ctx, nir_loop *nloop) br_back.branch.target_block = start_idx; emit_mir_instruction(ctx, br_back); - /* Mark down that branch in the graph */ - midgard_block_add_successor(ctx->current_block, start_block); + /* Mark down that branch in the graph. Note that we're really branching + * to the block *after* we started in. TODO: Why doesn't the branch + * itself have an off-by-one then...? */ + midgard_block_add_successor(ctx->current_block, start_block->successors[0]); /* Find the index of the block about to follow us (note: we don't add * one; blocks are 0-indexed so we get a fencepost problem) */ |