mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 19:00:13 +01:00
aco: only remove branch jumping over SMEM/barrier if it's never taken
SMEM might be an invalid access, and barriers are probably expensive. fossil-db (navi21): Totals from 126 (0.16% of 79395) affected shaders: Instrs: 2764965 -> 2765377 (+0.01%) CodeSize: 15155348 -> 15156788 (+0.01%) Latency: 17604293 -> 17604296 (+0.00%) Branches: 105211 -> 105623 (+0.39%) Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Backport-to: 24.1 Backport-to: 24.2 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30321>
This commit is contained in:
parent
b934255510
commit
c29d9f1184
1 changed files with 2 additions and 2 deletions
|
|
@ -2889,9 +2889,9 @@ lower_to_hw_instr(Program* program)
|
|||
can_remove = prefer_remove;
|
||||
} else if (inst->isSMEM()) {
|
||||
/* SMEM are at least as expensive as branches */
|
||||
can_remove = prefer_remove;
|
||||
can_remove = prefer_remove && branch->never_taken;
|
||||
} else if (inst->isBarrier()) {
|
||||
can_remove = prefer_remove;
|
||||
can_remove = prefer_remove && branch->never_taken;
|
||||
} else {
|
||||
can_remove = false;
|
||||
assert(false && "Pseudo instructions should be lowered by this point.");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue