[Mesa-dev] [PATCH v3 00/13] TGSI: improved live range tracking, also including arrays

Benedikt Schemmer ben at besd.de
Sun Apr 29 10:23:33 UTC 2018


Real world

(old vs new)
nothing vs register merge:

PERCENTAGE DELTAS    Shaders     SGPRs     VGPRs SpillSGPR SpillVGPR  PrivVGPR   Scratch  CodeSize  MaxWaves     Waits
 0ad                        6     .         .         .         .         .         .         .         .         .
 aer                      590     .        0.26 %  -20.00 %     .         .         .        0.34 %     .         .
 alien_isolation         1414     .         .         .         .         .         .         .         .         .
 anholt                    10     .         .         .         .         .         .         .         .         .
 bioshock_infinite       2581   -0.02 %     .         .         .         .         .        0.12 %     .         .
 blackmesa                584     .         .         .         .         .         .         .         .         .
 cat                      573     .       -0.02 %     .         .         .         .        0.11 %     .         .
 csgo                    1392     .         .       -0.88 %     .         .         .       -0.03 %     .         .
 deadisland_definitive   1776    0.06 %     .         .         .         .         .        0.15 %    0.01 %     .
 deadisland_original    11602     .         .         .         .         .         .        0.05 %     .         .
 deadisland_riptide_..    293   -0.06 %    0.06 %     .         .         .         .        0.32 %     .         .
 deusex_mankind          5051    0.14 %   -0.01 %   -1.57 %     .         .         .        0.18 %     .         .
 dirtrally                787   -0.04 %    0.15 %    1.08 %     .         .         .        0.27 %   -0.07 %     .
 dolphin                   22     .         .         .         .         .         .         .         .         .
 dyinglight              4012     .        0.05 %     .         .         .         .        0.34 %   -0.01 %     .
 eurotruck2               216     .         .         .         .         .         .         .         .         .
 f1_2015                  746   -0.04 %    0.02 %    0.93 %     .         .         .        0.08 %     .         .
 glamor                    16   -2.33 %     .         .         .         .         .        3.97 %     .         .
 hl2ep1                   294     .         .         .         .         .         .         .         .         .
 hl2ep2                   154     .         .         .         .         .         .         .         .         .
 hl2lostcoast              66     .         .         .         .         .         .         .         .         .
 hlsl3                    582     .         .         .         .         .         .       -0.14 %     .         .
 humus-celshading           4     .         .         .         .         .         .         .         .         .
 humus-domino               6     .         .         .         .         .         .         .         .         .
 humus-dynamicbranching    24     .         .         .         .         .         .         .         .         .
 humus-hdr                 10     .         .         .         .         .         .         .         .         .
 humus-portals              2     .         .         .         .         .         .         .         .         .
 humus-volumetricfog..      6     .         .         .         .         .         .         .         .         .
 kerbal                  1016     .        0.11 %     .         .         .         .        0.31 %     .         .
 larago                   664     .         .         .         .         .         .        0.01 %     .         .
 madmax                   354     .       -0.08 %     .         .         .         .       -0.02 %    0.04 %     .
 metro2033redux          4410     .        0.03 %     .         .         .         .        0.06 %   -0.01 %     .
 nexuiz                    80     .         .         .         .         .         .         .         .         .
 ruiner                   685     .       -0.02 %     .         .         .         .        0.04 %     .         .
 sauerbraten                7     .         .         .         .         .         .         .         .         .
 serioussam2017           736     .         .        7.59 %     .         .         .        0.05 %     .         .
 soma                     436     .         .         .         .         .         .         .         .         .
 specops                 1814     .         .         .         .         .         .        0.35 %     .         .
 stellaris                434     .         .         .         .         .         .        0.11 %     .         .
 supertuxkart               4     .         .         .         .         .         .         .         .         .
 talos                    762   -0.02 %     .        0.09 %     .         .         .        0.01 %     .         .
 tesseract                430     .         .         .         .         .         .         .         .         .
 tombraider              1012    0.25 %    0.31 %     .         .         .         .        0.20 %   -0.16 %     .
 total_war_shogun_2       176   -0.21 %     .       -2.10 %     .         .         .       -0.05 %     .         .
 total_war_warhammer      218     .        0.06 %     .         .         .         .         .       -0.06 %     .
 ubershaders               54   -2.04 %    0.20 %     .         .         .         .        0.81 %     .         .
 ug_gettysburg            149     .         .         .         .         .         .         .         .         .
 unigine_heaven           226     .         .         .         .         .         .         .         .         .
 unigine_superposition    733   -0.08 %    0.04 %     .         .         .         .        0.02 %     .         .
 unigine_valley           288     .         .         .         .         .         .         .         .         .
 unity                     72     .         .         .         .         .         .        0.04 %     .         .
 w40kdawn2                421     .         .         .         .         .         .       -0.17 %     .         .
 w40kdawn3                164    0.36 %     .         .         .         .         .         .         .         .
 warsow                   176     .         .         .         .         .         .         .         .         .
 warzone2100                4     .         .         .         .         .         .         .         .         .
 witcher2                 928   -0.05 %    0.04 %     .         .         .         .        0.04 %     .         .
 x3_albion                641     .         .         .         .         .         .         .         .         .
 xblades                  208     .         .         .         .         .         .        0.40 %     .         .
 xcom                    1020   -0.10 %     .         .         .         .         .        0.28 %     .         .
 xcom2                   1439     .         .         .         .         .         .         .         .         .
 yofrankie                 82     .         .         .         .         .         .         .         .         .
 ----------------------------------------------------------------------------------------------------------------------
 All affected            6226    0.10 %    0.11 %    0.84 %     .         .         .        0.47 %   -0.05 %     .
 ----------------------------------------------------------------------------------------------------------------------
 Total                  52662    0.01 %    0.02 %    0.45 %     .         .         .        0.12 %     .         .

register merge vs yours:

PERCENTAGE DELTAS    Shaders     SGPRs     VGPRs SpillSGPR SpillVGPR  PrivVGPR   Scratch  CodeSize  MaxWaves     Waits
 0ad                        6     .         .         .         .         .         .         .         .         .
 aer                      590     .       -0.26 %   25.00 %     .         .         .       -0.33 %     .         .
 alien_isolation         1414     .         .         .         .         .         .         .         .         .
 anholt                    10     .         .         .         .         .         .         .         .         .
 bioshock_infinite       2581    0.02 %     .         .         .         .         .       -0.12 %     .         .
 blackmesa                584     .         .         .         .         .         .         .         .         .
 cat                      573     .        0.02 %     .         .         .         .       -0.11 %     .         .
 csgo                    1392     .         .        0.89 %     .         .         .        0.03 %     .         .
 deadisland_definitive   1776   -0.06 %     .         .         .         .         .       -0.15 %   -0.01 %     .
 deadisland_original    11602     .         .         .         .         .         .       -0.05 %     .         .
 deadisland_riptide_..    293    0.06 %   -0.06 %     .         .         .         .       -0.32 %     .         .
 deusex_mankind          5051   -0.14 %    0.01 %    1.60 %     .         .         .       -0.18 %     .         .
 dirtrally                787    0.04 %   -0.15 %   -1.07 %     .         .         .       -0.26 %    0.07 %     .
 dolphin                   22     .         .         .         .         .         .         .         .         .
 dyinglight              4012     .       -0.05 %     .         .         .         .       -0.33 %    0.01 %     .
 eurotruck2               216     .         .         .         .         .         .         .         .         .
 f1_2015                  746    0.04 %   -0.02 %   -0.92 %     .         .         .       -0.08 %     .         .
 glamor                    16    2.38 %     .         .         .         .         .       -3.82 %     .         .
 hl2ep1                   294     .         .         .         .         .         .         .         .         .
 hl2ep2                   154     .         .         .         .         .         .         .         .         .
 hl2lostcoast              66     .         .         .         .         .         .         .         .         .
 hlsl3                    582     .         .         .         .         .         .        0.14 %     .         .
 humus-celshading           4     .         .         .         .         .         .         .         .         .
 humus-domino               6     .         .         .         .         .         .         .         .         .
 humus-dynamicbranching    24     .         .         .         .         .         .         .         .         .
 humus-hdr                 10     .         .         .         .         .         .         .         .         .
 humus-portals              2     .         .         .         .         .         .         .         .         .
 humus-volumetricfog..      6     .         .         .         .         .         .         .         .         .
 kerbal                  1016     .       -0.11 %     .         .         .         .       -0.31 %     .         .
 larago                   664     .         .         .         .         .         .       -0.01 %     .         .
 madmax                   354     .        0.08 %     .         .         .         .        0.02 %   -0.04 %     .
 metro2033redux          4410     .       -0.03 %     .         .         .         .       -0.06 %    0.01 %     .
 nexuiz                    80     .         .         .         .         .         .         .         .         .
 ruiner                   685     .        0.02 %     .         .         .         .       -0.04 %     .         .
 sauerbraten                7     .         .         .         .         .         .         .         .         .
 serioussam2017           736     .         .       -7.06 %     .         .         .       -0.05 %     .         .
 soma                     436     .         .         .         .         .         .         .         .         .
 specops                 1814     .         .         .         .         .         .       -0.34 %     .         .
 stellaris                434     .         .         .         .         .         .       -0.11 %     .         .
 supertuxkart               4     .         .         .         .         .         .         .         .         .
 talos                    762    0.02 %     .       -0.09 %     .         .         .       -0.01 %     .         .
 tesseract                430     .         .         .         .         .         .         .         .         .
 tombraider              1012   -0.25 %   -0.31 %     .         .         .         .       -0.20 %    0.16 %     .
 total_war_shogun_2       176    0.21 %     .        2.14 %     .         .         .        0.05 %     .         .
 total_war_warhammer      218     .       -0.06 %     .         .         .         .         .        0.06 %     .
 ubershaders               54    2.08 %   -0.20 %     .         .         .         .       -0.80 %     .         .
 ug_gettysburg            149     .         .         .         .         .         .         .         .         .
 unigine_heaven           226     .         .         .         .         .         .         .         .         .
 unigine_superposition    733    0.08 %   -0.04 %     .         .         .         .       -0.02 %     .         .
 unigine_valley           288     .         .         .         .         .         .         .         .         .
 unity                     72     .         .         .         .         .         .       -0.04 %     .         .
 w40kdawn2                421     .         .         .         .         .         .        0.17 %     .         .
 w40kdawn3                164   -0.36 %     .         .         .         .         .         .         .         .
 warsow                   176     .         .         .         .         .         .         .         .         .
 warzone2100                4     .         .         .         .         .         .         .         .         .
 witcher2                 928    0.05 %   -0.04 %     .         .         .         .       -0.04 %     .         .
 x3_albion                641     .         .         .         .         .         .         .         .         .
 xblades                  208     .         .         .         .         .         .       -0.40 %     .         .
 xcom                    1020    0.10 %     .         .         .         .         .       -0.28 %     .         .
 xcom2                   1439     .         .         .         .         .         .         .         .         .
 yofrankie                 82     .         .         .         .         .         .         .         .         .
 ----------------------------------------------------------------------------------------------------------------------
 All affected            6226   -0.10 %   -0.11 %   -0.83 %     .         .         .       -0.47 %    0.05 %     .
 ----------------------------------------------------------------------------------------------------------------------
 Total                  52662   -0.01 %   -0.02 %   -0.45 %     .         .         .       -0.12 %     .         .


Am 29.04.2018 um 11:34 schrieb Gert Wollny:
> Am Sonntag, den 29.04.2018, 10:43 +0200 schrieb Benedikt Schemmer:
>> Hi Gert,
>>
>> couldn't resist at least to try what would happen if I enable
>> register merge for radeonsi:
>>
>>  PERCENTAGE DELTAS    Shaders     SGPRs     VGPRs SpillSGPR
>> SpillVGPR  PrivVGPR   Scratch  CodeSize  MaxWaves     Waits
>>  piglit                 80732   -0.16 %   -0.02
>> %     .         .        0.87 %    0.86 %    0.04 %     .         .
>>  ------------------------------------------------------------------
>> ----------------------------------------------------
>>  All affected             513  -17.58 %   -2.30
>> %     .         .        4.12 %    5.87 %    1.73 %    0.10 %     .
>>  ------------------------------------------------------------------
>> ----------------------------------------------------
>>  Total                  80732   -0.16 %   -0.02
>> %     .         .        0.87 %    0.86 %    0.04 %     .         .
>>
>> I had already removed the defines around the debug code so thats also
>> happily outputting data.
>>
>> fails with two piglit shaders:
> Which are the names of these test? I'd like to check this on r600,
> because here I didn't see any regressions last time I checked. 
> 
> 
>> Real world is a little different:
> 
> I guess these tests refer to enabled register_merge - without and with
> this patch set, no? 
> 
> Out of curiosity, did you also look at how enabling register_merge
> (before this series) impacts the result as compared to the normal
> operation of radeonsi? 
>  
> 
>> If theres an easy way to figure out when your code makes it worse and
>> when its an improvement this would be really nice.
> 
> My insentive for this series was, that on r600 the arrays are allocated
>  before the final optimization pass on the byte code that requires that
> the number of registers is <= 124. When I started this no spilling was
> implemented, and shaders with too many arrays and registers would
> simply fail. Now spilling is impelmented, but AFAIK reducing the
> numbers of registers in the final optimization pass does not result in
> changed spilling, so bringing down the number of registers before tgsi-
> to-bytecode is still of interest. 
> 
> For radeonsi my guess would be that the llvm optimizer works better
> when the registers are not yet merged, and that would be the reason why
> register_merge is disabled. 
> 
> In any case, Timothy wrote in this thread [1] (last message) that he
> had similar patches for NIR. 
> 
> Best, 
> Gert 
> 
> [1] https://patchwork.freedesktop.org/patch/189842/
> 


More information about the mesa-dev mailing list