Skip to content

nir: Add some ssa-only fast-paths for nir_src rewrite

Basically every pass in NIR uses nir_ssa_def_rewrite_uses which calls nir_instr_rewrite_src which is fairly complex because it handles all sorts of non-SSA cases. Since we already know a priori that every source written by nir_ssa_def_rewrite_uses is SSA, we can check new_src once at the top of the function and cut out all that complexity.

While we're at it, we expose a new SSA-only nir_ssa_def_rewrite_uses_ssa helper which takes an SSA def which avoids the one SSA check. It's also more convenient 90% of the time.

Merge request reports

Loading