nir: Rewinding in nir_opt_algebraic()
In !2000 (closed) I proposed a change to fix O(n^2) behavior in algebraic on the CTS by running algebraic top-to-bottom along with bottom-to-top. @cwabbott0 suggested that we could use the automaton to figure out how far back we needed to step the IP after a replacement. It's not showing the wins on shader-db time that my other branch had, but on the other hand it has a negligible (~.01% instr count on intel and freedreno) impact on the generated shaders and still fixes the CTS runtime.
This series is based on !2104 (merged)