[TableGen] Fix D90844 introduced non-determinism due to iteration over a std::map...
authorFangrui Song <i@maskray.me>
Fri, 18 Dec 2020 20:08:16 +0000 (12:08 -0800)
committerFangrui Song <i@maskray.me>
Fri, 18 Dec 2020 20:08:16 +0000 (12:08 -0800)
commit9c978dd6e12e5ffaf5441f459db47e9892b09a82
treeaf224bc69509cc54ae4da523e841cc1eb47ea2d5
parent2af2f58ec09257d65a2a6f99f833a1b242d434a3
[TableGen] Fix D90844 introduced non-determinism due to iteration over a std::map over allocated object pointers

993eaf2d69d8beb97e4695cbd919b927ed1cfe86 (D90844) is still wrong.
The allocated const Record* pointers do not have an order guarantee
so switching from DenseMap to std::map does not help.

ProcModelMapTy = std::map<const Record*, unsigned>

Sort the values instead.
llvm/utils/TableGen/CodeGenSchedule.cpp
llvm/utils/TableGen/CodeGenSchedule.h