Skip to content

nir/range-analysis: Use types to provide better ranges from bcsel and mov

Ian Romanick requested to merge idr/mesa:review/range-analysis-cache into master

As a side-effect, this fixes problems with the hash key not including the type of an expression. As has been discussed in several MRs (!1444 (closed) and !2104 (merged)), there can be problems if an SSA value is interpreted as different types in different expressions.

All Gen7+ platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 16327543 -> 16315391 (-0.07%)
instructions in affected programs: 179150 -> 166998 (-6.78%)
helped: 824
HURT: 0
helped stats (abs) min: 1 max: 56 x̄: 14.75 x̃: 10
helped stats (rel) min: 0.37% max: 16.04% x̄: 7.20% x̃: 5.90%
95% mean confidence interval for instructions value: -15.44 -14.05
95% mean confidence interval for instructions %-change: -7.49% -6.91%
Instructions are helped.

total cycles in shared programs: 363682759 -> 363615417 (-0.02%)
cycles in affected programs: 1266667 -> 1199325 (-5.32%)
helped: 822
HURT: 0
helped stats (abs) min: 14 max: 624 x̄: 81.92 x̃: 68
helped stats (rel) min: 0.64% max: 13.89% x̄: 5.63% x̃: 5.59%
95% mean confidence interval for cycles value: -86.42 -77.43
95% mean confidence interval for cycles %-change: -5.81% -5.45%
Cycles are helped.

Sandy Bridge
total instructions in shared programs: 10785769 -> 10785654 (<.01%)
instructions in affected programs: 13725 -> 13610 (-0.84%)
helped: 65
HURT: 0
helped stats (abs) min: 1 max: 15 x̄: 1.77 x̃: 1
helped stats (rel) min: 0.20% max: 3.45% x̄: 0.89% x̃: 0.63%
95% mean confidence interval for instructions value: -2.40 -1.14
95% mean confidence interval for instructions %-change: -1.05% -0.72%
Instructions are helped.

total cycles in shared programs: 153704779 -> 153704481 (<.01%)
cycles in affected programs: 99348 -> 99050 (-0.30%)
helped: 37
HURT: 13
helped stats (abs) min: 1 max: 38 x̄: 12.30 x̃: 16
helped stats (rel) min: 0.05% max: 2.69% x̄: 0.87% x̃: 0.50%
HURT stats (abs)   min: 1 max: 36 x̄: 12.08 x̃: 7
HURT stats (rel)   min: 0.04% max: 2.53% x̄: 0.72% x̃: 0.44%
95% mean confidence interval for cycles value: -10.02 -1.90
95% mean confidence interval for cycles %-change: -0.76% -0.16%
Cycles are helped.

LOST:   2
GAINED: 0


No shader-db change on Iron Lake or GM45.

@anholt should be able to rebase !2104 (merged) on top of this, and it should "just work."

Edited by Ian Romanick

Merge request reports