mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 13:10:10 +01:00
radv: make use of nir_lower_load_const_to_scalar()
This allows NIR to CSE more operations. LLVM does this also so the impact is limited, however doing this in NIR allows other opts to make progress. For example in radeonsi more loops are unrolled in Civilization Beyond Earth. The actual pipeline-db stats are not overwhelming but even in the negatively affected shaders the NIR is clearly better. It just happens that the code shuffling and in some cases calls to max rather than a flt result in the final output from LLVM not giving as good numbers. However this is an incremental opt that further passes build off so the change should be made IMO. Totals from affected shaders: SGPRS: 20192 -> 20184 (-0.04 %) VGPRS: 19516 -> 19524 (0.04 %) Spilled SGPRs: 437 -> 444 (1.60 %) Spilled VGPRs: 0 -> 0 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 0 -> 0 (0.00 %) dwords per thread Code Size: 1527444 -> 1522276 (-0.34 %) bytes LDS: 6 -> 6 (0.00 %) blocks Max Waves: 1018 -> 1016 (-0.20 %) Wait states: 0 -> 0 (0.00 %) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
f03a160592
commit
72e4287e8f
1 changed files with 2 additions and 0 deletions
|
|
@ -316,6 +316,8 @@ radv_shader_compile_to_nir(struct radv_device *device,
|
|||
.lower_vote_eq_to_ballot = 1,
|
||||
});
|
||||
|
||||
nir_lower_load_const_to_scalar(nir);
|
||||
|
||||
if (!(flags & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT))
|
||||
radv_optimize_nir(nir, false);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue