summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-02-07 19:05:55 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-02-09 16:05:00 +0100
commit8e240e6153e089d23f646c7b3f2c5edff7ac223c (patch)
treeecaba2742170bd1c91fde566d7cce8c9af328176
parentd5263e4093e7fefacbbe3bbbec717cdf64856cbe (diff)
nvc0: store only one value per basic block for TGSI regs
-rw-r--r--src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c b/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c
index f53af6c49c..8c0967dfa8 100644
--- a/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c
+++ b/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c
@@ -63,7 +63,13 @@ bld_register_access(struct bld_register *reg, unsigned i)
static INLINE void
bld_register_add_val(struct bld_register *reg, struct nv_value *val)
{
- util_dynarray_append(&reg->vals, struct nv_value *, val);
+ struct nv_basic_block *bb = val->insn->bb;
+
+ if (reg->vals.size &&
+ (util_dynarray_top(&reg->vals, struct nv_value *))->insn->bb == bb)
+ *(util_dynarray_top_ptr(&reg->vals, struct nv_value *)) = val;
+ else
+ util_dynarray_append(&reg->vals, struct nv_value *, val);
}
static INLINE boolean