From 79c4d4213c2ad4eeec284c991946cc4b5f0956b5 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 30 Aug 2023 16:47:31 -0400 Subject: [PATCH] agx: Add agx_prev_block helper Signed-off-by: Alyssa Rosenzweig --- src/asahi/compiler/agx_compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/asahi/compiler/agx_compiler.h b/src/asahi/compiler/agx_compiler.h index 562a537c04c..a3c71a7f9e4 100644 --- a/src/asahi/compiler/agx_compiler.h +++ b/src/asahi/compiler/agx_compiler.h @@ -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) {