From 4c45503aaea6ae65c4b5cdcb13d905af7e6eb413 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 28 Aug 2023 13:53:06 -0400 Subject: [PATCH] nir: Add nir_before/after_impl cursors These are common enough to merit their own helpers. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Faith Ekstrand Reviewed-by: Kenneth Graunke Part-of: --- src/compiler/nir/nir.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index e7d1ca5..63ab487 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -4293,6 +4293,18 @@ nir_after_cf_list(struct exec_list *cf_list) return nir_after_cf_node(last_node); } +static inline nir_cursor +nir_before_impl(nir_function_impl *impl) +{ + return nir_before_cf_list(&impl->body); +} + +static inline nir_cursor +nir_after_impl(nir_function_impl *impl) +{ + return nir_after_cf_list(&impl->body); +} + /** * Insert a NIR instruction at the given cursor. * -- 2.7.4