pan/bi: Add a helper to convert to old-style nodes

RA, DCE, and liveness assume that SSA and non-SSA normal indices are
indexed from 1 in a shared address space, with a maximum given by
bi_max_temp. As a stop gap, let's translate bi_index to old style
node numbers so those passes can be updated cleanly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
This commit is contained in:
Alyssa Rosenzweig 2020-12-11 20:03:46 -05:00
parent 2d9147dae4
commit b85f317017
1 changed files with 9 additions and 0 deletions

View File

@ -769,6 +769,15 @@ bi_dest_index(nir_dest *dst)
}
}
static inline unsigned
bi_get_node(bi_index index)
{
if (bi_is_null(index) || index.type != BI_INDEX_NORMAL)
return ~0;
else
return (index.value << 1) | index.reg;
}
/* Iterators for Bifrost IR */
#define bi_foreach_block(ctx, v) \