diff options
author | Eric Anholt <[email protected]> | 2015-02-12 14:17:21 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-02-12 16:33:16 -0800 |
commit | 3f1e1287fd960966eee8b12a75c8a8f62e11cdd2 (patch) | |
tree | 9415b611ac95698b0d383b6565ac36a34178d358 /src/gallium/drivers/vc4/vc4_opt_dead_code.c | |
parent | 4413861dd835cf8b9143f3032b670635bd217bf6 (diff) |
vc4: Make SF be a flag on the QIR instructions.
Right now the places that used to emit a mov.sf just put the SF on the
previous instruction when it generated the source of the SF value. Even
without optimization to push the sf up further (and kill thus potentially
kill more MOVs), this gets us:
total uniforms in shared programs: 13455 -> 13457 (0.01%)
uniforms in affected programs: 3 -> 5 (66.67%)
total instructions in shared programs: 40296 -> 40198 (-0.24%)
instructions in affected programs: 12595 -> 12497 (-0.78%)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_opt_dead_code.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_opt_dead_code.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc4/vc4_opt_dead_code.c b/src/gallium/drivers/vc4/vc4_opt_dead_code.c index 94ab382500d..dd1561d68d4 100644 --- a/src/gallium/drivers/vc4/vc4_opt_dead_code.c +++ b/src/gallium/drivers/vc4/vc4_opt_dead_code.c @@ -43,6 +43,7 @@ dce(struct vc4_compile *c, struct qinst *inst) qir_dump_inst(c, inst); fprintf(stderr, "\n"); } + assert(!inst->sf); qir_remove_instruction(inst); } @@ -93,6 +94,7 @@ qir_opt_dead_code(struct vc4_compile *c) if (inst->dst.file == QFILE_TEMP && !used[inst->dst.index] && + !inst->sf && (!qir_has_side_effects(c, inst) || inst->op == QOP_TEX_RESULT) && !has_nonremovable_reads(c, inst)) { @@ -120,11 +122,16 @@ qir_opt_dead_code(struct vc4_compile *c) if (qir_depends_on_flags(inst)) sf_used = true; - if (inst->op == QOP_SF) { + if (inst->sf) { if (!sf_used) { - dce(c, inst); + if (debug) { + fprintf(stderr, "Removing SF on: "); + qir_dump_inst(c, inst); + fprintf(stderr, "\n"); + } + + inst->sf = false; progress = true; - continue; } sf_used = false; } |