Mesa (master): vc4: Don't conditionalize the src1 mov of qir_SEL().

Eric Anholt anholt at kemper.freedesktop.org
Wed Nov 23 00:47:32 UTC 2016


Module: Mesa
Branch: master
Commit: 414dbb2d5c48b7e9dc0dc8b14583f91415ca3960
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=414dbb2d5c48b7e9dc0dc8b14583f91415ca3960

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Nov 21 23:52:37 2016 -0800

vc4: Don't conditionalize the src1 mov of qir_SEL().

My thought in having both arguments conditionally moved was that it should
theoretically save some power by not doing work in those channels.
However, it ends up costing us instructions because we can't
register-coalesce the first of the MOVs, and it also introduces extra
scheduling dependencies.  The instruction cost would swamp whatever power
benefit I was hoping for.

shader-db results:
total instructions in shared programs: 100548 -> 99741 (-0.80%)
instructions in affected programs:     42450 -> 41643 (-1.90%)

With obvious outliers removed (I had an X11 emacs running over the network
in the "after" case), 3DMMES Taiji showed 1.07231% +/- 0.488241% fps
improvement (n=18, 30).

---

 src/gallium/drivers/vc4/vc4_qir.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_qir.h b/src/gallium/drivers/vc4/vc4_qir.h
index eebfdf0..ba3fbd7 100644
--- a/src/gallium/drivers/vc4/vc4_qir.h
+++ b/src/gallium/drivers/vc4/vc4_qir.h
@@ -757,10 +757,8 @@ static inline struct qreg
 qir_SEL(struct vc4_compile *c, uint8_t cond, struct qreg src0, struct qreg src1)
 {
         struct qreg t = qir_get_temp(c);
-        struct qinst *a = qir_MOV_dest(c, t, src0);
-        struct qinst *b = qir_MOV_dest(c, t, src1);
-        a->cond = cond;
-        b->cond = qpu_cond_complement(cond);
+        qir_MOV_dest(c, t, src1);
+        qir_MOV_dest(c, t, src0)->cond = cond;
         return t;
 }
 




More information about the mesa-commit mailing list