Skip to content

ir3/postsched: various minor improvements

Job Noorman requested to merge jnoorman/mesa:ir3-postsched-improvements into main

This series tries to improve ir3_postsched in two ways.

First, the calculation of max_delay is fixed/improved:

  • Don't include the delay of the node itself: max_delay is supposed to be delay from a node to the end of the block;
  • Include ss/sy delays: this gives a more realistic maximum delay estimate.

Second, don't prioritize "hard ready" instructions (instructions that don't have a delay for which nops should be inserted but can still have ss/sy delays). This has a slight negative effect on nops but improves sstall/systall. It also seems to improve actual render pass time.

(See the commit messages for more details.)

This has a overall positive effect on shader-db:

shader-db results
total instructions in shared programs: 4136649 -> 4105224 (-0.76%)
instructions in affected programs: 3136624 -> 3105199 (-1.00%)
helped: 14431
HURT: 3478
helped stats (abs) min: 1 max: 364 x̄: 3.40 x̃: 3
helped stats (rel) min: 0.03% max: 20.69% x̄: 4.44% x̃: 3.70%
HURT stats (abs)   min: 1 max: 150 x̄: 5.07 x̃: 3
HURT stats (rel)   min: 0.03% max: 41.67% x̄: 3.95% x̃: 1.96%
95% mean confidence interval for instructions value: -1.85 -1.66
95% mean confidence interval for instructions %-change: -2.88% -2.73%
Instructions are helped.

total nops in shared programs: 919601 -> 888176 (-3.42%) nops in affected programs: 761731 -> 730306 (-4.13%) helped: 14431 HURT: 3478 helped stats (abs) min: 1 max: 364 x̄: 3.40 x̃: 3 helped stats (rel) min: 0.08% max: 100.00% x̄: 51.84% x̃: 46.67% HURT stats (abs) min: 1 max: 150 x̄: 5.07 x̃: 3 HURT stats (rel) min: 0.00% max: 1800.00% x̄: 31.90% x̃: 12.50% 95% mean confidence interval for nops value: -1.85 -1.66 95% mean confidence interval for nops %-change: -36.47% -34.68% Nops are helped.

total non-nops in shared programs: 3217048 -> 3217048 (0.00%) non-nops in affected programs: 0 -> 0 helped: 0 HURT: 0

total mov in shared programs: 144229 -> 144229 (0.00%) mov in affected programs: 0 -> 0 helped: 0 HURT: 0

total cov in shared programs: 88704 -> 88704 (0.00%) cov in affected programs: 0 -> 0 helped: 0 HURT: 0

total dwords in shared programs: 8770864 -> 8778888 (0.09%) dwords in affected programs: 1883882 -> 1891906 (0.43%) helped: 1226 HURT: 1580 helped stats (abs) min: 2 max: 32 x̄: 7.72 x̃: 2 helped stats (rel) min: 0.03% max: 27.08% x̄: 2.09% x̃: 0.78% HURT stats (abs) min: 2 max: 132 x̄: 11.07 x̃: 4 HURT stats (rel) min: 0.02% max: 60.00% x̄: 4.37% x̃: 1.04% 95% mean confidence interval for dwords value: 2.33 3.39 95% mean confidence interval for dwords %-change: 1.30% 1.79% Dwords are HURT.

total last-baryf in shared programs: 131900 -> 130915 (-0.75%) last-baryf in affected programs: 68792 -> 67807 (-1.43%) helped: 517 HURT: 280 helped stats (abs) min: 1 max: 45 x̄: 4.85 x̃: 3 helped stats (rel) min: 0.45% max: 60.00% x̄: 9.33% x̃: 6.14% HURT stats (abs) min: 1 max: 51 x̄: 5.44 x̃: 3 HURT stats (rel) min: 0.49% max: 100.00% x̄: 10.63% x̃: 5.22% 95% mean confidence interval for last-baryf value: -1.75 -0.72 95% mean confidence interval for last-baryf %-change: -3.33% -1.30% Last-baryf are helped.

total last-helper in shared programs: 1144864 -> 1131900 (-1.13%) last-helper in affected programs: 980188 -> 967224 (-1.32%) helped: 2065 HURT: 1806 helped stats (abs) min: 1 max: 364 x̄: 18.29 x̃: 5 helped stats (rel) min: 0.03% max: 92.37% x̄: 11.03% x̃: 3.23% HURT stats (abs) min: 1 max: 247 x̄: 13.74 x̃: 5 HURT stats (rel) min: 0.03% max: 430.77% x̄: 20.17% x̃: 4.80% 95% mean confidence interval for last-helper value: -4.32 -2.37 95% mean confidence interval for last-helper %-change: 2.40% 4.65% Inconclusive result (value mean confidence interval and %-change mean confidence interval disagree).

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

total full in shared programs: 254152 -> 254152 (0.00%) full in affected programs: 0 -> 0 helped: 0 HURT: 0

total constlen in shared programs: 628940 -> 628940 (0.00%) constlen in affected programs: 0 -> 0 helped: 0 HURT: 0

total cat0 in shared programs: 1018358 -> 986933 (-3.09%) cat0 in affected programs: 829544 -> 798119 (-3.79%) helped: 14431 HURT: 3478 helped stats (abs) min: 1 max: 364 x̄: 3.40 x̃: 3 helped stats (rel) min: 0.07% max: 92.31% x̄: 36.94% x̃: 35.29% HURT stats (abs) min: 1 max: 150 x̄: 5.07 x̃: 3 HURT stats (rel) min: 0.06% max: 900.00% x̄: 29.14% x̃: 12.50% 95% mean confidence interval for cat0 value: -1.85 -1.66 95% mean confidence interval for cat0 %-change: -24.77% -23.46% Cat0 are helped.

total cat1 in shared programs: 234377 -> 234377 (0.00%) cat1 in affected programs: 0 -> 0 helped: 0 HURT: 0

total cat2 in shared programs: 1501600 -> 1501600 (0.00%) cat2 in affected programs: 0 -> 0 helped: 0 HURT: 0

total cat3 in shared programs: 1196828 -> 1196828 (0.00%) cat3 in affected programs: 0 -> 0 helped: 0 HURT: 0

total cat4 in shared programs: 84089 -> 84089 (0.00%) cat4 in affected programs: 0 -> 0 helped: 0 HURT: 0

total cat5 in shared programs: 48109 -> 48109 (0.00%) cat5 in affected programs: 0 -> 0 helped: 0 HURT: 0

total cat6 in shared programs: 50156 -> 50156 (0.00%) cat6 in affected programs: 0 -> 0 helped: 0 HURT: 0

total cat7 in shared programs: 3132 -> 3132 (0.00%) cat7 in affected programs: 0 -> 0 helped: 0 HURT: 0

total stp in shared programs: 2448 -> 2448 (0.00%) stp in affected programs: 0 -> 0 helped: 0 HURT: 0

total ldp in shared programs: 568 -> 568 (0.00%) ldp in affected programs: 0 -> 0 helped: 0 HURT: 0

total sstall in shared programs: 351842 -> 335784 (-4.56%) sstall in affected programs: 247514 -> 231456 (-6.49%) helped: 3661 HURT: 1972 helped stats (abs) min: 1 max: 85 x̄: 6.84 x̃: 6 helped stats (rel) min: 0.18% max: 100.00% x̄: 30.77% x̃: 21.05% HURT stats (abs) min: 1 max: 90 x̄: 4.55 x̃: 3 HURT stats (rel) min: 0.00% max: 1300.00% x̄: 41.63% x̃: 12.16% 95% mean confidence interval for sstall value: -3.07 -2.63 95% mean confidence interval for sstall %-change: -7.23% -3.62% Sstall are helped.

total (ss) in shared programs: 88067 -> 85394 (-3.04%) (ss) in affected programs: 43287 -> 40614 (-6.18%) helped: 2936 HURT: 828 helped stats (abs) min: 1 max: 13 x̄: 1.30 x̃: 1 helped stats (rel) min: 0.85% max: 66.67% x̄: 20.06% x̃: 16.67% HURT stats (abs) min: 1 max: 41 x̄: 1.37 x̃: 1 HURT stats (rel) min: 0.00% max: 100.00% x̄: 26.78% x̃: 20.00% 95% mean confidence interval for (ss) value: -0.76 -0.66 95% mean confidence interval for (ss) %-change: -10.56% -8.96% (ss) are helped.

total systall in shared programs: 743774 -> 650040 (-12.60%) systall in affected programs: 506151 -> 412417 (-18.52%) helped: 3673 HURT: 1220 helped stats (abs) min: 1 max: 3112 x̄: 28.11 x̃: 13 helped stats (rel) min: 0.03% max: 100.00% x̄: 32.86% x̃: 24.55% HURT stats (abs) min: 1 max: 93 x̄: 7.81 x̃: 5 HURT stats (rel) min: 0.00% max: 2000.00% x̄: 30.41% x̃: 9.48% 95% mean confidence interval for systall value: -21.19 -17.12 95% mean confidence interval for systall %-change: -19.15% -15.02% Systall are helped.

total (sy) in shared programs: 38299 -> 35562 (-7.15%) (sy) in affected programs: 10639 -> 7902 (-25.73%) helped: 1645 HURT: 58 helped stats (abs) min: 1 max: 94 x̄: 1.70 x̃: 1 helped stats (rel) min: 2.50% max: 87.50% x̄: 37.61% x̃: 33.33% HURT stats (abs) min: 1 max: 4 x̄: 1.05 x̃: 1 HURT stats (rel) min: 9.09% max: 100.00% x̄: 32.32% x̃: 25.00% 95% mean confidence interval for (sy) value: -1.75 -1.47 95% mean confidence interval for (sy) %-change: -36.32% -34.14% (sy) are helped.

total waves in shared programs: 630114 -> 630114 (0.00%) waves in affected programs: 0 -> 0 helped: 0 HURT: 0

total loops in shared programs: 1085 -> 1085 (0.00%) loops in affected programs: 0 -> 0 helped: 0 HURT: 0

LOST: 0 GAINED: 0

I also measured the render pass time over some d3d11 traces which shows about 1% improvement overall.

Merge request reports

Loading