agx: Add agx_prev_block helper
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Wed, 30 Aug 2023 20:47:31 +0000 (16:47 -0400)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 1 Oct 2023 16:32:11 +0000 (12:32 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/asahi/compiler/agx_compiler.h

index 562a537..a3c71a7 100644 (file)
@@ -602,6 +602,12 @@ agx_predecessor_index(agx_block *succ, agx_block *pred)
    unreachable("Invalid predecessor");
 }
 
+static inline agx_block *
+agx_prev_block(agx_block *ins)
+{
+   return list_last_entry(&(ins->link), agx_block, link);
+}
+
 static inline agx_instr *
 agx_prev_op(agx_instr *ins)
 {