Skip to content

etnaviv: convert to new-style NIR registers

Christian Gmeiner requested to merge austriancoder/mesa:nir-legacy into main

What does this MR do and why?

There is an ongoing effort to transition away from nir_register and abs/neg/sat modifiers. And this effort is making wonderful progress and etnaviv should not block it (with the unlikely removal of etnaviv if block for too long).

For more details have a look here.

Backends have the choice of four different strategies to do the move. Sadly the one recommended for etnaviv - nir_legacy - does not work. The biggest problem is doing RA with nir. I spend countless hours debugging liveness analysis problems and gave up. I moved to the chasing helpers strategy - CI is happy and so I am.

There is only one single - I would not call it problem - regression as we don't fold fabs/fneg/fsat and we emit them always which results with a sad shader-db. But this is the pill to swallow as the current compiler is held together with duct-tape and hay-wire. The overall architecture makes it really hard to add new features and the missing backend IR does not help.

So here are the shader-db stats you all have waited for.

GC2000:

total instructions in shared programs: 228098 -> 249817 (9.52%)
instructions in affected programs: 97892 -> 119611 (22.19%)
helped: 2
HURT: 5433
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 3.85% max: 3.85% x̄: 3.85% x̃: 3.85%
HURT stats (abs)   min: 1 max: 48 x̄: 4.00 x̃: 3
HURT stats (rel)   min: 0.49% max: 200.00% x̄: 38.91% x̃: 33.33%
95% mean confidence interval for instructions value: 3.87 4.12
95% mean confidence interval for instructions %-change: 38.26% 39.54%
Instructions are HURT.

total temps in shared programs: 84665 -> 86158 (1.76%)
temps in affected programs: 6257 -> 7750 (23.86%)
helped: 27
HURT: 1515
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 10.00% max: 33.33% x̄: 25.78% x̃: 25.00%
HURT stats (abs)   min: 1 max: 2 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 4.76% max: 50.00% x̄: 29.54% x̃: 33.33%
95% mean confidence interval for temps value: 0.95 0.98
95% mean confidence interval for temps %-change: 27.96% 29.19%
Temps are HURT.

total immediates in shared programs: 152272 -> 152148 (-0.08%)
immediates in affected programs: 2304 -> 2180 (-5.38%)
helped: 29
HURT: 3
helped stats (abs) min: 4 max: 8 x̄: 4.69 x̃: 4
helped stats (rel) min: 2.63% max: 40.00% x̄: 14.65% x̃: 5.71%
HURT stats (abs)   min: 4 max: 4 x̄: 4.00 x̃: 4
HURT stats (rel)   min: 11.11% max: 12.50% x̄: 11.57% x̃: 11.11%
95% mean confidence interval for immediates value: -4.94 -2.81
95% mean confidence interval for immediates %-change: -17.67% -6.72%
Immediates are helped.

total loops in shared programs: 0 -> 0
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

LOST:   29
GAINED: 0
GC3000:

total instructions in shared programs: 404655 -> 418676 (3.46%)
instructions in affected programs: 93391 -> 107412 (15.01%)
helped: 2
HURT: 3536
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 3.70% max: 3.70% x̄: 3.70% x̃: 3.70%
HURT stats (abs)   min: 1 max: 102 x̄: 3.97 x̃: 3
HURT stats (rel)   min: 0.49% max: 200.00% x̄: 32.86% x̃: 25.00%
95% mean confidence interval for instructions value: 3.76 4.17
95% mean confidence interval for instructions %-change: 32.08% 33.59%
Instructions are HURT.

total temps in shared programs: 86490 -> 86998 (0.59%)
temps in affected programs: 2720 -> 3228 (18.68%)
helped: 28
HURT: 526
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 10.00% max: 33.33% x̄: 25.25% x̃: 25.00%
HURT stats (abs)   min: 1 max: 6 x̄: 1.02 x̃: 1
HURT stats (rel)   min: 4.76% max: 50.00% x̄: 29.04% x̃: 25.00%
95% mean confidence interval for temps value: 0.88 0.96
95% mean confidence interval for temps %-change: 24.75% 27.85%
Temps are HURT.

total immediates in shared programs: 143132 -> 142720 (-0.29%)
immediates in affected programs: 4468 -> 4056 (-9.22%)
helped: 89
HURT: 4
helped stats (abs) min: 4 max: 16 x̄: 4.81 x̃: 4
helped stats (rel) min: 2.22% max: 100.00% x̄: 41.28% x̃: 20.00%
HURT stats (abs)   min: 4 max: 4 x̄: 4.00 x̃: 4
HURT stats (rel)   min: 11.11% max: 12.50% x̄: 11.81% x̃: 11.81%
95% mean confidence interval for immediates value: -5.02 -3.84
95% mean confidence interval for immediates %-change: -47.61% -30.38%
Immediates are helped.

total loops in shared programs: 0 -> 0
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

LOST:   0
GAINED: 0
GC7000:

total instructions in shared programs: 404550 -> 418571 (3.47%)
instructions in affected programs: 93363 -> 107384 (15.02%)
helped: 2
HURT: 3536
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 3.70% max: 3.70% x̄: 3.70% x̃: 3.70%
HURT stats (abs)   min: 1 max: 102 x̄: 3.97 x̃: 3
HURT stats (rel)   min: 0.49% max: 200.00% x̄: 32.88% x̃: 25.00%
95% mean confidence interval for instructions value: 3.76 4.17
95% mean confidence interval for instructions %-change: 32.10% 33.61%
Instructions are HURT.

total temps in shared programs: 86469 -> 86977 (0.59%)
temps in affected programs: 2720 -> 3228 (18.68%)
helped: 28
HURT: 526
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 10.00% max: 33.33% x̄: 25.25% x̃: 25.00%
HURT stats (abs)   min: 1 max: 6 x̄: 1.02 x̃: 1
HURT stats (rel)   min: 4.76% max: 50.00% x̄: 29.04% x̃: 25.00%
95% mean confidence interval for temps value: 0.88 0.96
95% mean confidence interval for temps %-change: 24.75% 27.85%
Temps are HURT.

total immediates in shared programs: 143044 -> 142636 (-0.29%)
immediates in affected programs: 4456 -> 4048 (-9.16%)
helped: 88
HURT: 4
helped stats (abs) min: 4 max: 16 x̄: 4.82 x̃: 4
helped stats (rel) min: 2.22% max: 100.00% x̄: 41.37% x̃: 20.00%
HURT stats (abs)   min: 4 max: 4 x̄: 4.00 x̃: 4
HURT stats (rel)   min: 11.11% max: 12.50% x̄: 11.81% x̃: 11.81%
95% mean confidence interval for immediates value: -5.03 -3.84
95% mean confidence interval for immediates %-change: -47.77% -30.34%
Immediates are helped.

total loops in shared programs: 0 -> 0
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

LOST:   0
GAINED: 0

I started to work on something that will help and I hope it lands before the next branch point.

Merge request reports