nir: Rewrite nir_opt_rematerialize
Looking at !4616 (merged), I realized that it might help a bit if we could re-materialize the things which we want to eventually turn into source modifiers. Then I realized we already almost had a pass for that, it was just written in a way that was specific to comparisons used by bcsel
and if
statements. This MR reworks it so that it fits into the nir_opt_move
family and takes a nir_move_options
so that it can be easily extended to do more things. That ended up being a bit more of a rewrite than I initially intended but I think it's over-all a good thing. It's broken up into so many patches because I tried to keep the shader-db affecting and clean-up changes as separate as possible.