aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-26 13:59:29 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-30 15:50:24 -0700
commitd6e4e36566272288bc5f618ee2b7ae677bcf87dd (patch)
treeedb58ed5388566c34e3741dbd86b5102a8738f1a
parentbd79cddafad1894ec6f768b614bbc8f03db539f7 (diff)
pan/midgard: Include condition in branch->src[0]
This will allow us to reference the condition while scheduling. Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/panfrost/midgard/midgard_compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 69966854b11..04d149f2b60 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -1416,6 +1416,10 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
bool conditional = instr->intrinsic == nir_intrinsic_discard_if;
struct midgard_instruction discard = v_branch(conditional, false);
discard.branch.target_type = TARGET_DISCARD;
+
+ if (conditional)
+ discard.src[0] = nir_src_index(ctx, &instr->src[0]);
+
emit_mir_instruction(ctx, discard);
break;
}
@@ -2318,6 +2322,7 @@ emit_if(struct compiler_context *ctx, nir_if *nif)
/* Speculatively emit the branch, but we can't fill it in until later */
EMIT(branch, true, true);
midgard_instruction *then_branch = mir_last_in_block(ctx->current_block);
+ then_branch->src[0] = nir_src_index(ctx, &nif->condition);
/* Emit the two subblocks. */
midgard_block *then_block = emit_cf_list(ctx, &nif->then_list);