From 5cfae66cdea1cd1bd669d3b22247185e8a90a187 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 2 May 2022 15:28:38 -0400 Subject: [PATCH] pan/bi: Ensure the end NOP isn't eliminated Otherwise the lowering doesn't work. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index c76d2a1f6f2..787032cb1ba 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -4460,7 +4460,12 @@ static void bi_lower_terminal_block(bi_context *ctx, bi_block *block) { bi_builder b = bi_init_builder(ctx, bi_after_block(block)); - bi_nop(&b); + + /* Ensure the instruction is not dead code eliminated. XXX: This is a + * bit of a hack. + */ + bi_instr *I = bi_nop(&b); + I->flow = 0xF; } static void