As suggested by @djtodoro in https://reviews.llvm.org/D88891#2843425 , there's a std::map in MachineFunction that doesn't need to be ordered through most of compilation, only at the end. It can be replaced with a vector that gets ordered when needed, which is what this patch does.
NFCI, and only affects the experimental instruction-referencing work that's currently hidden behind a flag.
I guess this needs clang-format