diff --git a/src/broadcom/compiler/vir_register_allocate.c b/src/broadcom/compiler/vir_register_allocate.c index 3e20faf94cc..1be36ccbace 100644 --- a/src/broadcom/compiler/vir_register_allocate.c +++ b/src/broadcom/compiler/vir_register_allocate.c @@ -44,17 +44,20 @@ qinst_writes_tmu(struct qinst *inst) static bool is_end_of_tmu_sequence(struct qinst *inst, struct qblock *block) { - if (inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU && - inst->qpu.alu.add.op == V3D_QPU_A_TMUWT) - return true; - - if (!inst->qpu.sig.ldtmu) + if (!inst->qpu.sig.ldtmu && + !(inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU && + inst->qpu.alu.add.op != V3D_QPU_A_TMUWT)) { return false; + } list_for_each_entry_from(struct qinst, scan_inst, inst->link.next, &block->instructions, link) { - if (scan_inst->qpu.sig.ldtmu) + if (scan_inst->qpu.sig.ldtmu || + (inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU && + inst->qpu.alu.add.op == V3D_QPU_A_TMUWT)) { return false; + } + if (qinst_writes_tmu(scan_inst)) return true; }