aco: optimize boolean phis with uniform selections

Graphics / Mesa 3D Graphics Library / Mesa - Rhys Perry [gmail.com] - 10 July 2020 22:36 UTC

Even though the boolean can be divergent, the control flow can be (at least partially) uniform. For example, we don't have to create any s_andn2_b64/s_and_b64/s_or_b64 instructions with this code: a = ... loop { b = bool_phi a, c if (uniform) break c = ... } d = phi c

fossil-db (Navi): Totals from 5506 (4.05% of 135946) affected shaders: SGPRs: 605720 -> 604024 (-0.28%) SpillSGPRs: 52025 -> 51733 (-0.56%) CodeSize: 65221188 -> 64957808 (-0.40%); split: -0.41%, +0.00% Instrs: 12637881 -> 12584610 (-0.42%); split: -0.42%, +0.00%

9a089baff1a aco: optimize boolean phis with uniform selections
src/amd/compiler/aco_lower_phis.cpp | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share