nir: Add nir_before/after_impl cursors

These are common enough to merit their own helpers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24910>
This commit is contained in:
Alyssa Rosenzweig 2023-08-28 13:53:06 -04:00 committed by Marge Bot
parent bd0d3c7b1c
commit 4c45503aae

View file

@ -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.
*