Module: Mesa
Branch: main
Commit: 5cfae66cdea1cd1bd669d3b22247185e8a90a187
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5cfae66cdea1cd1bd669d3b22247185e8a90a187

Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May  2 15:28:38 2022 -0400

pan/bi: Ensure the end NOP isn't eliminated

Otherwise the lowering doesn't work.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16410>

---

 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

Reply via email to