nir: add strength reduction pattern for imod/irem with pow2 divisor.
authorDaniel Schürmann <daniel.schuermann@campus.tu-berlin.de>
Wed, 30 Jan 2019 10:04:55 +0000 (11:04 +0100)
committerDaniel Schürmann <daniel@schuermann.dev>
Fri, 13 Nov 2020 14:59:03 +0000 (15:59 +0100)
commit0ef5f3552f68076747211ec81f687b37a5540d8e
tree727378d8d248de9414f9a240c1fab631e9f788e6
parente96afeeb7bb2306aa0fba76e27163d4c7a86860b
nir: add strength reduction pattern for imod/irem with pow2 divisor.

Affected games are Detroit : Become Human and Doom : Eternal.

Totals from 6262 (4.54% of 138013) affected shaders (RAVEN):
SGPRs: 678472 -> 678640 (+0.02%)
VGPRs: 498288 -> 498360 (+0.01%)
CodeSize: 67064196 -> 65926000 (-1.70%)
MaxWaves: 19390 -> 19382 (-0.04%)
Instrs: 13175372 -> 12932517 (-1.84%)
Cycles: 1444043256 -> 1443022576 (-0.07%); split: -0.08%, +0.01%
VMEM: 929560 -> 908726 (-2.24%); split: +0.39%, -2.63%
SMEM: 406207 -> 400062 (-1.51%); split: +0.46%, -1.97%
VClause: 215168 -> 215031 (-0.06%)
SClause: 443312 -> 442324 (-0.22%); split: -0.25%, +0.03%
Copies: 1350793 -> 1344326 (-0.48%); split: -0.52%, +0.04%
Branches: 506432 -> 506370 (-0.01%); split: -0.02%, +0.01%
PreSGPRs: 619652 -> 619619 (-0.01%)
PreVGPRs: 473212 -> 473168 (-0.01%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/175>
src/compiler/nir/nir_opt_algebraic.py