diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 4f1408e73e9..aa980c49707 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -778,6 +778,15 @@ bi_get_node(bi_index index) return (index.value << 1) | index.reg; } +static inline bi_index +bi_node_to_index(unsigned node, unsigned node_count) +{ + assert(node < node_count); + assert(node_count < ~0); + + return bi_get_index(node >> 1, node & PAN_IS_REG, 0); +} + /* Iterators for Bifrost IR */ #define bi_foreach_block(ctx, v) \