mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
broadcom/compiler: flag wrtmuc with a read dependency on last_tmu_config
Instead of using a write depdency. We use last_tmu_config to ensure ordering of instructions participating in different TMU sequences. To this end, all sequence terminators flag a write dependency on last_tmu_config, but wrtmuc is not a sequence terminator, so we can be more flexible by flagging it as a read depedency. This would prevent it to be moved into a previous sequence (since it cannot be moved past the previous sequence terminator due to the read depedency), but it allows it to be reordered with instructions in the same sequence, which allows us to pair it up more effectively. Particularly, it allows to pair up a wrtmuc with the sequence terminator of the same sequence, turning code like this: nop ; mov tmut, r0 ; thrsw; wrtmuc (tex[0].p0 | 0x3) nop ; nop ; wrtmuc (tex[0].p1 | 0x0) nop ; mov tmus, r1 Into this: nop ; mov tmut, r0 ; thrsw; wrtmuc (tex[0].p0 | 0x3) nop ; mov tmus, r1 ; wrtmuc (tex[0].p1 | 0x0) total instructions in shared programs: 13755738 -> 13735183 (-0.15%) instructions in affected programs: 2510921 -> 2490366 (-0.82%) helped: 10963 HURT: 485 Instructions are helped. total max-temps in shared programs: 2322828 -> 2322020 (-0.03%) max-temps in affected programs: 11303 -> 10495 (-7.15%) helped: 608 HURT: 19 Max-temps are helped. total sfu-stalls in shared programs: 31545 -> 31494 (-0.16%) sfu-stalls in affected programs: 235 -> 184 (-21.70%) helped: 62 HURT: 11 Sfu-stalls are helped. total inst-and-stalls in shared programs: 13787283 -> 13766677 (-0.15%) inst-and-stalls in affected programs: 2525187 -> 2504581 (-0.82%) helped: 10989 HURT: 477 Inst-and-stalls are helped. v2: add a comment explaining the read depdency (Piñeiro). Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9555>
This commit is contained in:
parent
6d6fd57e09
commit
87ed614c47
1 changed files with 5 additions and 1 deletions
|
|
@ -386,8 +386,12 @@ calculate_deps(struct schedule_state *state, struct schedule_node *n)
|
|||
add_write_dep(state, &state->last_tmu_write, n);
|
||||
}
|
||||
|
||||
/* Allow wrtmuc to be reordered with other instructions in the
|
||||
* same TMU sequence by using a read dependency on the last TMU
|
||||
* sequence terminator.
|
||||
*/
|
||||
if (inst->sig.wrtmuc)
|
||||
add_write_dep(state, &state->last_tmu_config, n);
|
||||
add_read_dep(state, state->last_tmu_config, n);
|
||||
|
||||
if (inst->sig.ldtlb | inst->sig.ldtlbu)
|
||||
add_write_dep(state, &state->last_tlb, n);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue