craig.topper added a comment. Every Record has an ID that is assigned in order. You can just sort the Records based on that in your emitter Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82388/new/ https://reviews.llvm.org/D82388