From: Christoph Bumiller Date: Mon, 7 Feb 2011 18:05:55 +0000 (+0100) Subject: nvc0: store only one value per basic block for TGSI regs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e240e6153e089d23f646c7b3f2c5edff7ac223c;p=mesa.git nvc0: store only one value per basic block for TGSI regs --- diff --git a/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c b/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c index f53af6c49c3..8c0967dfa87 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(®->vals, struct nv_value *, val); + struct nv_basic_block *bb = val->insn->bb; + + if (reg->vals.size && + (util_dynarray_top(®->vals, struct nv_value *))->insn->bb == bb) + *(util_dynarray_top_ptr(®->vals, struct nv_value *)) = val; + else + util_dynarray_append(®->vals, struct nv_value *, val); } static INLINE boolean