freedreno/ir3: hack to avoid getting stuck in a loop

There are still some edge cases which result in a neighbor-loop.  Which
needs to be fixed, but this hack at least makes deqp tests finish.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
Rob Clark
2016-04-11 13:03:51 -04:00
parent dd70945e09
commit f68f6c0246

View File

@@ -308,8 +308,14 @@ struct ir3_instruction {
static inline struct ir3_instruction * static inline struct ir3_instruction *
ir3_neighbor_first(struct ir3_instruction *instr) ir3_neighbor_first(struct ir3_instruction *instr)
{ {
while (instr->cp.left) int cnt = 0;
while (instr->cp.left) {
instr = instr->cp.left; instr = instr->cp.left;
if (++cnt > 0xffff) {
debug_assert(0);
break;
}
}
return instr; return instr;
} }
@@ -322,6 +328,10 @@ static inline int ir3_neighbor_count(struct ir3_instruction *instr)
while (instr->cp.right) { while (instr->cp.right) {
num++; num++;
instr = instr->cp.right; instr = instr->cp.right;
if (num > 0xffff) {
debug_assert(0);
break;
}
} }
return num; return num;