aco: Improve SCC nocompare optimization when SCC is clobbered.
authorTimur Kristóf <timur.kristof@gmail.com>
Wed, 13 Apr 2022 17:29:30 +0000 (19:29 +0200)
committerMarge Bot <emma+marge@anholt.net>
Sat, 20 Aug 2022 15:27:40 +0000 (15:27 +0000)
commit1762e6b5406bf6c0ebec84a21fa8eb62f812dd2b
tree16d08e4fb2763060133390d9f5446fe7bf40b94e
parente69de0f81d69fe4405e91b7a088adb855bc66f06
aco: Improve SCC nocompare optimization when SCC is clobbered.

When SCC is clobbered between s_cmp and its operand's writer,
the current optimization that eliminates s_cmp won't kick in.

However, when s_cmp is the only user of its operand temporary,
it is possible to "pull down" the instruction that wrote the operand.

Fossil DB stats on Navi 21:

Totals from 63302 (46.92% of 134906) affected shaders:
CodeSize: 176689272 -> 176418332 (-0.15%)
Instrs: 33552237 -> 33484502 (-0.20%)
Latency: 205847485 -> 205816205 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 34321285 -> 34319908 (-0.00%); split: -0.00%, +0.00%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16266>
src/amd/compiler/aco_optimizer_postRA.cpp
src/amd/compiler/tests/test_optimizer_postRA.cpp