Avoid revisiting same nodes back to back in node remapping pass, which can cause exponential increase in memory usage for programs with large loops containing nested branching.
Use variable map for operands in phi node arguments to avoid orphaned variable when that variable comes from a store of another stored variable across branches.
This fixes two RIR transformation bugs: