Skip to content

nir: recombine nir_op_*sub when lower_sub = false

Daniel Schürmann requested to merge daniel-schuermann/mesa:nir_lower_sub into master

There are some optimizations which are only implemented for additions and some optimizations which assume that subtractions have been lowered. By lowering all subtractions first and later recombine for backends which prefer this option, we don't have to implement them twice.

Supersedes !1236 (closed) !2049 (closed) !1961 (closed)

v3d currently doesn't call nir_opt_algebraic_late which should be added. I'm not sure which other backends don't lower_sub, but we should ensure that these do the same.

This series changes for ACO: 40228 shaders in 20236 tests

  • Totals:
  • SGPRS: 2045512 -> 2043256 (-0.11 %)
  • VGPRS: 1430856 -> 1431984 (0.08 %)
  • Spilled SGPRs: 1077 -> 1077 (0.00 %)
  • Spilled VGPRs: 0 -> 0 (0.00 %)
  • Private memory VGPRs: 0 -> 0 (0.00 %)
  • Scratch size: 10348 -> 10348 (0.00 %) dwords per thread
  • Code Size: 77202840 -> 77061484 (-0.18 %) bytes
  • LDS: 863 -> 863 (0.00 %) blocks
  • Max Waves: 260729 -> 260623 (-0.04 %)
Edited by Daniel Schürmann

Merge request reports