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.
for (const auto &PM : ProcModelMap)
if (PM.second != 0)
ProcIdVec.push_back(PM.second);
+ // The order of the keys (Record pointers) of ProcModelMap are not stable.
+ // Sort to stabalize the values.
+ llvm::sort(ProcIdVec);
return ProcIdVec;
}
ArrayRef<OpcodeGroup> getGroups() const { return Groups; }
};
-using ProcModelMapTy = std::map<const Record*, unsigned>;
+using ProcModelMapTy = DenseMap<const Record *, unsigned>;
/// Top level container for machine model data.
class CodeGenSchedModels {