agx: Remove nir_register support

We don't use it anymore, now that we can handle SSA form. Gets rid of
the most gross hack in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16268>
This commit is contained in:
Alyssa Rosenzweig
2022-05-01 17:51:09 -04:00
parent 3927a9e911
commit 18ef9398de
3 changed files with 5 additions and 66 deletions

View File

@@ -58,7 +58,6 @@ enum agx_index_type {
AGX_INDEX_IMMEDIATE = 2,
AGX_INDEX_UNIFORM = 3,
AGX_INDEX_REGISTER = 4,
AGX_INDEX_NIR_REGISTER = 5,
};
enum agx_size {
@@ -138,16 +137,6 @@ agx_register(uint8_t imm, enum agx_size size)
};
}
static inline agx_index
agx_nir_register(unsigned imm, enum agx_size size)
{
return (agx_index) {
.value = imm,
.size = size,
.type = AGX_INDEX_NIR_REGISTER,
};
}
/* Also in half-words */
static inline agx_index
agx_uniform(uint8_t imm, enum agx_size size)
@@ -389,13 +378,6 @@ typedef struct {
/* Remapping table for varyings indexed by driver_location */
unsigned varyings[AGX_MAX_VARYINGS];
/* Handling phi nodes is still TODO while we bring up other parts of the
* driver. YOLO the mapping of nir_register to fixed hardware registers */
unsigned *nir_regalloc;
/* We reserve the top (XXX: that hurts thread count) */
unsigned max_register;
/* Place to start pushing new values */
unsigned push_base;
@@ -460,10 +442,7 @@ agx_size_for_bits(unsigned bits)
static inline agx_index
agx_src_index(nir_src *src)
{
if (!src->is_ssa) {
return agx_nir_register(src->reg.reg->index,
agx_size_for_bits(nir_src_bit_size(*src)));
}
assert(src->is_ssa);
return agx_get_index(src->ssa->index,
agx_size_for_bits(nir_src_bit_size(*src)));
@@ -472,10 +451,7 @@ agx_src_index(nir_src *src)
static inline agx_index
agx_dest_index(nir_dest *dst)
{
if (!dst->is_ssa) {
return agx_nir_register(dst->reg.reg->index,
agx_size_for_bits(nir_dest_bit_size(*dst)));
}
assert(dst->is_ssa);
return agx_get_index(dst->ssa.index,
agx_size_for_bits(nir_dest_bit_size(*dst)));