[Mesa-dev] [PATCH 3/9] nir/opt_peephole_select: Don't peephole_select expensive math instructions

Timothy Arceri tarceri at itsqueeze.com
Wed Oct 10 00:00:30 UTC 2018


On 10/10/18 10:31 am, Ian Romanick wrote:
> On 10/09/2018 03:42 PM, Timothy Arceri wrote:
>> Hi Ian,
>>
>> You might be interested in doing something like this [1]. It needs some
>> tidy up (and likely further testing) but my initial results showed a
>> fairly large number of select can be converted to ifs just based on
>> having a ubo load.
>>
>> [1] https://gitlab.freedesktop.org/tarceri/mesa/commits/bcsel-to-if
> 
> So... this is basically doing the inverse of nir_opt_peephole_select if
> one of the bcsel choices is the only use of a UBO load?  That is clever. :)
> 

Yep it will also continue past the UBO load gathering as many 
instructions as it can that are only used to produce the input of the 
bcsel. It could be easily expanded for your expensive math.


More information about the mesa-dev mailing list