Skip to content

treewide: Avoid nir_lower_regs_to_ssa calls

Alyssa Rosenzweig requested to merge alyssa/mesa:treewide/remove-lower into main

nir_registers are only supposed to be used temporarily. They may be created by a producer, but then must be immediately lowered prior to optimizing the produced shader. They may be created internally by an optimization pass that doesn't want to deal with phis, but that pass needs to lower them back to phis immediately. Finally they may be created when going out-of-SSA if a backend chooses, but that has to happen late.

Regardless, there should be no case where a backend sees a shader that comes in with nir_registers needing to be lowered. The two frontend producers of registers (tgsi_to_nir and mesa/st) both call nir_lower_regs_to_ssa to clean up as they should. Some backend (like intel) already depend on this behaviour. There's no need for other backends to call nir_lower_regs_to_ssa too.

Drop the pointless calls as a baby step towards replacing nir_register.

Signed-off-by: Alyssa Rosenzweig alyssa@rosenzweig.io

Merge request reports