Skip to content

Draft: RFC: enable Global Code Motion in RADV

Timothy Arceri requested to merge tarceri/mesa:gcm_radv into main

This a fork of !597 (merged) which enables support for RADV rather than i965/ANV. Since this didn't produce many changes in RADV with LLVM I had attempted to land initial support with reviews from the Intel guys but seems they have been busy with other things. Now that we have ACO this might be more useful for RADV.

The series makes some improvements to the in tree GCM pass (which isn't enabled for any drivers), this series makes GCM much less destructive to the IRs ordering of instructions and makes things a bit more conservative for the initial enablement of the pass. The idea is that we can then make it more aggressive in future, add heuristics, etc.

When attempting to test Global Value Numbering it caused ACO to assert with [1] in an f1-2017 pipeline so GVN is disabled for now.

[1] ../src/amd/compiler/aco_spill.cpp:579: aco::RegisterDemand aco::{anonymous}::init_live_in_vars(aco::{anonymous}::spill_ctx&, aco::Block*, unsigned int): Assertion `!partial_spills.empty()' failed.

Overall vkpipeline-db results for ACO (VEGA64):

 PERCENTAGE DELTAS    Shaders     SGPRs     VGPRs SpillSGPR SpillVGPR  PrivVGPR   Scratch  CodeSize  MaxWaves     Waits
 batman-arkham-city      2581     .         .         .         .         .         .         .         .         .    
 dark-souls-3             881     .         .         .         .         .         .         .         .         .    
 dawn-of-war-3            244     .         .         .         .         .         .         .         .         .    
 f1-2017                 5627    0.05 %   -0.02 %     .         .         .         .       -0.01 %     .         .    
 fallout4-vr              196   12.91 %    7.42 %     .         .         .         .       -6.45 %     .         .    
 nier                    1905     .         .         .         .         .         .         .         .         .    
 no-mans-sky             4054    0.05 %    3.00 %   10.53 %     .         .         .       -0.38 %   -0.61 %     .    
 prey                    2182    0.09 %     .         .         .         .         .       -0.01 %     .         .    
 rot-tomb-raider         8391     .         .         .         .         .         .         .         .         .    
 skyrim-vr                494   14.26 %    5.48 %     .         .         .         .       -6.53 %     .         .    
 sot-tomb-raider          613     .         .         .         .         .         .         .         .         .    
 the_witcher_3-medium     803     .         .         .         .         .         .         .         .         .    
 the_wither_3-ultra      1040     .         .         .         .         .         .         .         .         .    
 valve-vr-pref-trace      323     .         .         .         .         .         .         .         .         .    
 wolfenstein-2           1056    0.05 %     .         .         .         .         .       -0.06 %     .         .    
 ----------------------------------------------------------------------------------------------------------------------
 All affected            1033    6.71 %    7.19 %   10.53 %     .         .         .       -1.38 %   -3.63 %     .    
 ----------------------------------------------------------------------------------------------------------------------
 Total                  30390    0.28 %    0.39 %    2.68 %     .         .         .       -0.17 %   -0.09 %     .    

Overall vkpipeline-db results for LLVM (VEGA64):

 PERCENTAGE DELTAS    Shaders     SGPRs     VGPRs SpillSGPR SpillVGPR  PrivVGPR   Scratch  CodeSize  MaxWaves     Waits
 batman-arkham-city      2581     .         .         .         .         .         .         .         .         .    
 dark-souls-3             881     .         .         .         .         .         .         .         .         .    
 dawn-of-war-3            244     .         .         .         .         .         .         .         .         .    
 f1-2017                 5627     .         .         .         .         .         .         .         .         .    
 fallout4-vr              196   12.00 %     .         .         .         .         .       -3.70 %     .         .    
 nier                    1905     .         .         .         .         .         .         .         .         .    
 no-mans-sky             4054    0.35 %    0.05 %     .         .         .         .       -0.24 %   -0.01 %     .    
 prey                    2182     .         .         .         .         .         .         .         .         .    
 rot-tomb-raider         8391     .         .         .         .         .         .         .         .         .    
 skyrim-vr                494   13.10 %     .         .         .         .         .       -3.86 %     .         .    
 sot-tomb-raider          613     .         .         .         .         .         .         .         .         .    
 the_witcher_3-medium     803     .         .         .         .         .         .         .         .         .    
 the_wither_3-ultra      1040     .         .         .         .         .         .         .         .         .    
 valve-vr-pref-trace      323     .         .         .         .         .         .         .         .         .    
 wolfenstein-2           1056     .         .         .         .         .         .         .         .         .    
 ----------------------------------------------------------------------------------------------------------------------
 All affected             448   17.88 %    0.36 %     .         .         .         .       -3.21 %   -0.13 %     .    
 ----------------------------------------------------------------------------------------------------------------------
 Total                  30390    0.31 %     .         .         .         .         .       -0.09 %     .         .    
Edited by Jordan Justen

Merge request reports

Loading