Skip to content

radv,aco,ac/llvm,nir: move multiplication by 1/2pi to NIR using nir_op_fsin_r600/nir_op_fcos_r600

This lets NIR optimize the multiplication, particularly sin/cos(a * #b).

fossil-db (Sienna Cichlid):

Totals from 10430 (6.96% of 149839) affected shaders:
VGPRs: 690752 -> 690768 (+0.00%); split: -0.00%, +0.01%
CodeSize: 78300508 -> 78191092 (-0.14%); split: -0.14%, +0.00%
MaxWaves: 177034 -> 177050 (+0.01%)
Instrs: 14855162 -> 14832562 (-0.15%); split: -0.15%, +0.00%
Latency: 519724049 -> 519618802 (-0.02%); split: -0.03%, +0.01%
InvThroughput: 126244652 -> 126203656 (-0.03%); split: -0.04%, +0.01%
VClause: 218726 -> 218751 (+0.01%); split: -0.01%, +0.02%
SClause: 524413 -> 524198 (-0.04%); split: -0.06%, +0.02%
Copies: 1071997 -> 1071836 (-0.02%); split: -0.04%, +0.02%
Branches: 519565 -> 519547 (-0.00%); split: -0.00%, +0.00%
PreSGPRs: 794188 -> 793893 (-0.04%); split: -0.04%, +0.00%
PreVGPRs: 633036 -> 633033 (-0.00%); split: -0.00%, +0.00%

fossil-db (LLVM, Sienna Cichlid):

Totals from 4377 (3.59% of 121873) affected shaders:
SGPRs: 358960 -> 359176 (+0.06%); split: -0.18%, +0.25%
VGPRs: 319832 -> 319720 (-0.04%); split: -0.18%, +0.15%
SpillSGPRs: 46983 -> 47007 (+0.05%); split: -0.99%, +1.04%
CodeSize: 30872812 -> 30764512 (-0.35%); split: -0.39%, +0.04%
MaxWaves: 73814 -> 73904 (+0.12%); split: +0.25%, -0.13%

Merge request reports