Mesa (master): freedreno/ir3: relax restriction in grouping

Rob Clark robclark at kemper.freedesktop.org
Sun Apr 24 17:43:41 UTC 2016


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

Author: Rob Clark <robclark at freedesktop.org>
Date:   Sun Apr 24 11:40:12 2016 -0400

freedreno/ir3: relax restriction in grouping

Currently we were two restrictive, and would insert an output move in
cases like: MOV OUT[0], IN[0].xyzw

Loosen the restriction to allow the current instruction to appear in the
neighbor list but only at it's current possition.

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

---

 src/gallium/drivers/freedreno/ir3/ir3_group.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_group.c b/src/gallium/drivers/freedreno/ir3/ir3_group.c
index f229fe6..633d66c 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_group.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_group.c
@@ -92,8 +92,10 @@ static struct group_ops instr_ops = { instr_get, instr_insert_mov };
 
 /* verify that cur != instr, but cur is also not in instr's neighbor-list: */
 static bool
-in_neighbor_list(struct ir3_instruction *instr, struct ir3_instruction *cur)
+in_neighbor_list(struct ir3_instruction *instr, struct ir3_instruction *cur, int pos)
 {
+	int idx = 0;
+
 	if (!instr)
 		return false;
 
@@ -101,7 +103,7 @@ in_neighbor_list(struct ir3_instruction *instr, struct ir3_instruction *cur)
 		return true;
 
 	for (instr = ir3_neighbor_first(instr); instr; instr = instr->cp.right)
-		if (instr == cur)
+		if ((idx++ != pos) && (instr == cur))
 			return true;
 
 	return false;
@@ -137,7 +139,7 @@ restart:
 
 			/* we also can't have an instr twice in the group: */
 			for (j = i + 1; (j < n) && !conflict; j++)
-				if (in_neighbor_list(ops->get(arr, j), instr))
+				if (in_neighbor_list(ops->get(arr, j), instr, i))
 					conflict = true;
 
 			if (conflict) {




More information about the mesa-commit mailing list