[Mesa-dev] A few NIR compile time optimisations

Timothy Arceri tarceri at itsqueeze.com
Wed Feb 20 00:07:39 UTC 2019



On 20/2/19 10:59 am, Timothy Arceri wrote:
> On 20/2/19 10:49 am, Marek Olšák wrote:
>> st_link_shader takes 55% of CPU time with NIR, and 9% with TGSI.
>>
>> nir_validate_shader 49%
>>
>> nir_validate_shader is overused. It doesn't make sense even in debug 
>> builds.
> 
> It's used to validate the IR between optimisation/lowering passes. For 
> debug builds you can use NIR_VALIDATE=0 to avoid it.
> 
> Note since I sent this we have tracked down and removed some excessive 
> processing in nir_opt_dead_cf() and Connor has also sent a MR to 
> significantly reduce time spent in nir_opt_algebraic [1].
> 
> The overhead from NIR has reduce to about 30% of time spent compiling 
> shader-db with everything that's already landed and Connors series.

To clarify that is ~30% extra time to compile shader-db on the NIR 
backed vs the TGSI backend.

So in other words the NIR overhead has almost halved since I sent this 
series a week ago :)

> 
> I intend to do some more profiling today. I added compile times to 
> shader-db so that I can pinpoint problem shaders.
> 
> [1] https://gitlab.freedesktop.org/mesa/mesa/merge_requests/269
> 
>>
>> Marek
>>
>> On Wed, Feb 13, 2019 at 4:26 AM Connor Abbott <cwabbott0 at gmail.com 
>> <mailto:cwabbott0 at gmail.com>> wrote:
>>
>>     Reviewed-by: Connor Abbott <cwabbott0 at gmail.com
>>     <mailto:cwabbott0 at gmail.com>>
>>
>>     I'm a bit surprised it's that slow... do you have any idea what's
>>     going on? I've made flamegraphs in the past on i965 to see where
>>     most of the time is spent.
>>
>>     On Wed, Feb 13, 2019 at 9:00 AM Timothy Arceri
>>     <tarceri at itsqueeze.com <mailto:tarceri at itsqueeze.com>> wrote:
>>
>>         Currently the radeonsi NIR backend takes around twice the time
>>         of the tgsi backend to compile shader-db. These are some first
>>         steps at reducing the overhead of NIR.
>>
>>         This series reduces the compile time of a Deus Ex program I was
>>         profiling by around 5%.
>>
>>
>>         _______________________________________________
>>         mesa-dev mailing list
>>         mesa-dev at lists.freedesktop.org
>>         <mailto:mesa-dev at lists.freedesktop.org>
>>         https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
>>     _______________________________________________
>>     mesa-dev mailing list
>>     mesa-dev at lists.freedesktop.org 
>> <mailto:mesa-dev at lists.freedesktop.org>
>>     https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list