From: Alyssa Rosenzweig Date: Wed, 11 Mar 2020 18:51:57 +0000 (-0400) Subject: pan/bi: Add bi_max_temp helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0bff6e5e076e5ae7f188b07ce069647ef7eff0c6;p=mesa.git 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 Part-of: --- diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 93f8639c1d9..9c64a910f6f 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -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) {