Mesa (9.1): mesa/program: Don't copy propagate from swizzles.

Ian Romanick idr at kemper.freedesktop.org
Wed May 29 20:37:33 UTC 2013


Module: Mesa
Branch: 9.1
Commit: c2fd5a19855052f42d3410c5a215a083610897fb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2fd5a19855052f42d3410c5a215a083610897fb

Author: Fabian Bieler <fabianbieler at fastmail.fm>
Date:   Thu Apr 25 01:30:15 2013 +0200

mesa/program: Don't copy propagate from swizzles.

Do not propagate a copy if source and destination are identical.

Otherwise code like

MOV TEMP[0].xyzw, TEMP[0].wzyx
MOV TEMP[1].xyzw, TEMP[0].xyzw

is changed to

MOV TEMP[0].xyzw, TEMP[0].wzyx
MOV TEMP[1].xyzw, TEMP[0].wzyx

This fixes Piglit test shaders/glsl-copy-propagation-self-2 for drivers that
use Mesa IR.

NOTE: This is a candidate for the stable branches.
Signed-off-by: Fabian Bieler <fabianbieler at fastmail.fm>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
(cherry picked from commit 4e9c7f9c5ac7b2564c1c7299bf688595e1f88372)

---

 src/mesa/program/ir_to_mesa.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index ce409ec..b2d0d6c 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2744,6 +2744,8 @@ ir_to_mesa_visitor::copy_propagate(void)
       /* If this is a copy, add it to the ACP. */
       if (inst->op == OPCODE_MOV &&
 	  inst->dst.file == PROGRAM_TEMPORARY &&
+	  !(inst->dst.file == inst->src[0].file &&
+	    inst->dst.index == inst->src[0].index) &&
 	  !inst->dst.reladdr &&
 	  !inst->saturate &&
 	  !inst->src[0].reladdr &&




More information about the mesa-commit mailing list