diff --git a/.pick_status.json b/.pick_status.json index 1875bb8075b..5f6a5700255 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4,7 +4,7 @@ "description": "broadcom/compiler: avoid using ldvary sequence to hide latency of branching", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/broadcom/compiler/qpu_schedule.c b/src/broadcom/compiler/qpu_schedule.c index 4b9a01fda8f..517c9eb5741 100644 --- a/src/broadcom/compiler/qpu_schedule.c +++ b/src/broadcom/compiler/qpu_schedule.c @@ -1953,6 +1953,14 @@ emit_branch(struct v3d_compile *c, break; } + /* Do not move up a branch if it can disrupt an ldvary sequence + * as that can cause stomping of the r5 register. + */ + if (scoreboard->last_ldvary_tick + 2 >= + branch_tick - slots_filled) { + break; + } + /* Can't move a conditional branch before the instruction * that writes the flags for its condition. */