Mesa (master): freedreno/ir3: only tex instructions have wrmask

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 12 22:32:46 UTC 2019


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Fri Nov  1 15:17:22 2019 -0700

freedreno/ir3: only tex instructions have wrmask

At the ir3 level, we would assume that we could use wrmask to mask
off other components of an instruction returning a vecN when they are
not used.  Which would let RA use components not written for other live
values.  But this is only true for tex instructions.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/freedreno/ir3/ir3_depth.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/freedreno/ir3/ir3_depth.c b/src/freedreno/ir3/ir3_depth.c
index bdd00693104..4bbd1e56d7c 100644
--- a/src/freedreno/ir3/ir3_depth.c
+++ b/src/freedreno/ir3/ir3_depth.c
@@ -177,13 +177,10 @@ remove_unused_by_block(struct ir3_block *block)
 		if (instr->flags & IR3_INSTR_UNUSED) {
 			if (instr->opc == OPC_META_SPLIT) {
 				struct ir3_instruction *src = ssa(instr->regs[1]);
-				/* leave inputs alone.. we can't optimize out components of
-				 * an input, since the hw is still going to be writing all
-				 * of the components, and we could end up in a situation
-				 * where multiple inputs overlap.
+				/* tex (cat5) instructions have a writemask, so we can
+				 * mask off unused components.  Other instructions do not.
 				 */
-				if ((src->opc != OPC_META_INPUT) &&
-						(src->regs[0]->wrmask > 1)) {
+				if (is_tex(src) && (src->regs[0]->wrmask > 1)) {
 					src->regs[0]->wrmask &= ~(1 << instr->split.off);
 
 					/* prune no-longer needed right-neighbors.  We could




More information about the mesa-commit mailing list