24a18b1a4b
This will create code that is easier to combine into MADs/FMA when the last component is 1.0. nir_opt_algebraic_late has an optimization to do something similar but it only works for inexact code, if the multiplication-by-1 optimization is done before it and if the backend enables fuse_ffma. fossil-db (Navi): Totals from 85583 (74.64% of 114665) affected shaders: SGPRs: 4556060 -> 4558596 (+0.06%); split: -0.07%, +0.12% VGPRs: 3315060 -> 3312984 (-0.06%); split: -0.23%, +0.17% SpillSGPRs: 13552 -> 13553 (+0.01%) CodeSize: 184962756 -> 184431388 (-0.29%); split: -0.32%, +0.03% MaxWaves: 1208693 -> 1209361 (+0.06%); split: +0.17%, -0.11% Instrs: 35678819 -> 35361617 (-0.89%); split: -0.91%, +0.02% Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5631>