This patch fixes non-determinism we had during rematerialization of the live values. There were two sources of it:
- We need to iterate through rematerialization candidates in a stable order. Fix is achieved by sorting them prior to the loop (similarly to other places in this pass)
- We used DenseSet to keep already rematerialized values. Fixed by changing storage from DenseSet to vector of pairs.