Mesa (master): freedreno/ir3: don't cp into phi's

Rob Clark robclark at kemper.freedesktop.org
Tue Apr 5 00:23:19 UTC 2016


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

Author: Rob Clark <robclark at freedesktop.org>
Date:   Mon Apr  4 17:34:57 2016 -0400

freedreno/ir3: don't cp into phi's

The block defining a phi source might not have been executed.  If we
allow copy propagation, we could end up pointing to a src instruction in
the wrong block.

Signed-off-by: Rob Clark <robclark at freedesktop.org>

---

 src/gallium/drivers/freedreno/ir3/ir3_cp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cp.c b/src/gallium/drivers/freedreno/ir3/ir3_cp.c
index 00fa353..f032f0b 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_cp.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_cp.c
@@ -230,6 +230,12 @@ reg_cp(struct ir3_instruction *instr, struct ir3_register *reg, unsigned n)
 {
 	struct ir3_instruction *src = ssa(reg);
 
+	/* don't propagate copies into a PHI, since we don't know if the
+	 * src block executed:
+	 */
+	if (instr->opc == OPC_META_PHI)
+		return;
+
 	if (is_eligible_mov(src, true)) {
 		/* simple case, no immed/const/relativ, only mov's w/ ssa src: */
 		struct ir3_register *src_reg = src->regs[1];




More information about the mesa-commit mailing list