pan/bi: Add bi_max_temp helper

Instead of trying to reindex all the times, just be okay with consistent
but sparse indices, then figuring out the max index is easy enough.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
This commit is contained in:
Alyssa Rosenzweig 2020-03-11 14:51:57 -04:00 committed by Marge Bot
parent 6e0479a6a8
commit 0bff6e5e07
1 changed files with 7 additions and 0 deletions

View File

@ -377,6 +377,13 @@ bi_remove_instruction(bi_instruction *ins)
#define BIR_SPECIAL ((BIR_INDEX_REGISTER | BIR_INDEX_UNIFORM) | \
(BIR_INDEX_CONSTANT | BIR_INDEX_ZERO)
static inline unsigned
bi_max_temp(bi_context *ctx)
{
unsigned alloc = MAX2(ctx->impl->reg_alloc, ctx->impl->ssa_alloc);
return ((alloc + 1 + ctx->temp_alloc) << 1) | BIR_IS_REG;
}
static inline unsigned
bi_make_temp(bi_context *ctx)
{