Skip to content

intel/compiler: Fold constants after distributing source modifiers

Kenneth Graunke requested to merge kwg/mesa:const-fold-mods into main

This can generate things like fneg! of load_const, which is silly. Fold those away into an actual constant. Only do so on the scalar backend because there's a comment above that the vec4 backend doesn't want any new constants this late, and I'm inclined to believe it.

fossil-db stats show a very minor improvement:

Totals: Instrs: 203091223 -> 203091099 (-0.00%); split: -0.00%, +0.00% Cycles: 14410638075 -> 14410577067 (-0.00%); split: -0.00%, +0.00%

Totals from 20 (0.00% of 665070) affected shaders: Instrs: 27067 -> 26943 (-0.46%); split: -0.47%, +0.01% Cycles: 2687958 -> 2626950 (-2.27%); split: -2.27%, +0.00%

Merge request reports

Loading