aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_opt_copy_propagation.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-02-19 13:22:31 -0800
committerEric Anholt <[email protected]>2015-02-19 23:35:17 -0800
commit85316d059c899ac096331251de6b233229aa0b4f (patch)
tree27431fdde4bf5bcc03c52b2c3f94c16bb19f04a8 /src/gallium/drivers/vc4/vc4_opt_copy_propagation.c
parent877b48a531adc397493e508e509aba2918915349 (diff)
vc4: Keep an array of pointers to instructions defining the temps around.
The optimization passes are always regenerating it and throwing it away, but it's not hard to keep track of.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_opt_copy_propagation.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_opt_copy_propagation.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gallium/drivers/vc4/vc4_opt_copy_propagation.c b/src/gallium/drivers/vc4/vc4_opt_copy_propagation.c
index f8c49a44bd3..5189a401248 100644
--- a/src/gallium/drivers/vc4/vc4_opt_copy_propagation.c
+++ b/src/gallium/drivers/vc4/vc4_opt_copy_propagation.c
@@ -41,14 +41,10 @@ qir_opt_copy_propagation(struct vc4_compile *c)
struct simple_node *node;
bool debug = false;
struct qreg *movs = calloc(c->num_temps, sizeof(struct qreg));
- struct qinst **defs = calloc(c->num_temps, sizeof(struct qreg));
foreach(node, &c->instructions) {
struct qinst *inst = (struct qinst *)node;
- if (inst->dst.file == QFILE_TEMP)
- defs[inst->dst.index] = inst;
-
for (int i = 0; i < qir_get_op_nsrc(inst->op); i++) {
int index = inst->src[i].index;
if (inst->src[i].file == QFILE_TEMP &&
@@ -76,13 +72,12 @@ qir_opt_copy_propagation(struct vc4_compile *c)
inst->dst.file == QFILE_TEMP &&
inst->src[0].file != QFILE_VPM &&
!(inst->src[0].file == QFILE_TEMP &&
- (defs[inst->src[0].index]->op == QOP_TEX_RESULT ||
- defs[inst->src[0].index]->op == QOP_TLB_COLOR_READ))) {
+ (c->defs[inst->src[0].index]->op == QOP_TEX_RESULT ||
+ c->defs[inst->src[0].index]->op == QOP_TLB_COLOR_READ))) {
movs[inst->dst.index] = inst->src[0];
}
}
free(movs);
- free(defs);
return progress;
}