summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-11-16 14:57:11 +1100
committerTimothy Arceri <[email protected]>2018-12-10 13:59:50 +1100
commit6b961eb5347bcd3a3db4c96726a6ab4bad5420df (patch)
treea1900cc459f9d05406ad280b164b91447cd6eea9 /src/compiler/nir
parent03d7c65ad8644eb547295ffc95d14ba80a3d94cd (diff)
nir: add a new nir_cf_list_clone_and_reinsert() helper
Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_control_flow.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_control_flow.h b/src/compiler/nir/nir_control_flow.h
index 2ea460e5df3..9111b30a297 100644
--- a/src/compiler/nir/nir_control_flow.h
+++ b/src/compiler/nir/nir_control_flow.h
@@ -146,6 +146,16 @@ void nir_cf_list_clone(nir_cf_list *dst, nir_cf_list *src, nir_cf_node *parent,
struct hash_table *remap_table);
static inline void
+nir_cf_list_clone_and_reinsert(nir_cf_list *src_list, nir_cf_node *parent,
+ nir_cursor cursor,
+ struct hash_table *remap_table)
+{
+ nir_cf_list list;
+ nir_cf_list_clone(&list, src_list, parent, remap_table);
+ nir_cf_reinsert(&list, cursor);
+}
+
+static inline void
nir_cf_list_extract(nir_cf_list *extracted, struct exec_list *cf_list)
{
nir_cf_extract(extracted, nir_before_cf_list(cf_list),