[Mesa-dev] [PATCH 0/6] nir: Implement a load-combine pass

Eduardo Lima Mitev elima at igalia.com
Thu Apr 14 17:05:55 UTC 2016


On 04/14/2016 06:52 PM, Eduardo Lima Mitev wrote:
> Hi,
> 
> This is a series adding a new NIR pass that will combine redundant SSBO, shared variable and image load instructions. It is based on a previous series that Iago Toral [1] sent a few months ago, which I have updated to account for changes in NIR since then, and also added support for shared variables and image load/store.
> 
> Currently, the emitted load instructions for these types of variables are highly redundant. For example, assuming 'value' is an SSBO float, doing:
> 
> float next = value + 1.0;
> float prev = value - 1.0;
> 
> will generate two redundant load_ssbo instructions. The extreme case of this is:
> 
> mat4 mult = ssbo_mat4 * ssbo_mat4;
> 
> which will spwan 16 load_ssbo instructions.
> 
> Compute shader's shared variables and image loads (from ARB_image_load_store) suffer from the same problem. This pass coaleses the redundant loads, and is also able to combine a load with a previous store to the same address.
> 
> I'm still working on a piglit test series that tied up the different corner cases, but it doesn't hurt to get a few eyes on this already. The WIP piglit branch is at: https://github.com/Igalia/piglit/commits/nir-opt-load-combine-rc1
> You can see there a test example for the matrix multiplication cases: https://github.com/Igalia/piglit/commit/b7ea6d2553891c7eec993c39352a10925ebcefbc. This pass is able to reduce the emitted instructions from 210 to 134 (~64%), comparing to Mesa master.
> 

On a gen7 (HSW GT2).

And there are only 5 patches, not 6. The last one in the branch was a
debug-only patch that was removed.

Eduardo



More information about the mesa-dev mailing list