summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachinePipeliner.cpp
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2018-04-06 18:08:42 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2018-04-06 18:08:42 +0000
commit8ba42a9352f40b854085e97126678e6231756971 (patch)
tree589f63127a3ca6b9ecc77562008afd170a4e2127 /lib/CodeGen/MachinePipeliner.cpp
parent65256d7e66b9af6c90fdb637c396097b1738a83d (diff)
[CodeGen] Change std::sort to llvm::sort in response to r327219
Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: bogner, rnk, MatzeB, RKSimon Reviewed By: rnk Subscribers: JDevlieghere, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D45133 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachinePipeliner.cpp')
-rw-r--r--lib/CodeGen/MachinePipeliner.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/MachinePipeliner.cpp b/lib/CodeGen/MachinePipeliner.cpp
index 7a201bc3baa..061d9712036 100644
--- a/lib/CodeGen/MachinePipeliner.cpp
+++ b/lib/CodeGen/MachinePipeliner.cpp
@@ -931,7 +931,7 @@ void SwingSchedulerDAG::schedule() {
}
});
- std::sort(NodeSets.begin(), NodeSets.end(), std::greater<NodeSet>());
+ llvm::sort(NodeSets.begin(), NodeSets.end(), std::greater<NodeSet>());
groupRemainingNodes(NodeSets);
@@ -1863,7 +1863,8 @@ void SwingSchedulerDAG::registerPressureFilter(NodeSetType &NodeSets) {
RecRPTracker.closeBottom();
std::vector<SUnit *> SUnits(NS.begin(), NS.end());
- std::sort(SUnits.begin(), SUnits.end(), [](const SUnit *A, const SUnit *B) {
+ llvm::sort(SUnits.begin(), SUnits.end(),
+ [](const SUnit *A, const SUnit *B) {
return A->NodeNum > B->NodeNum;
});
@@ -3980,7 +3981,7 @@ void SwingSchedulerDAG::checkValidNodeOrder(const NodeSetType &Circuits) const {
};
// sort, so that we can perform a binary search
- std::sort(Indices.begin(), Indices.end(), CompareKey);
+ llvm::sort(Indices.begin(), Indices.end(), CompareKey);
bool Valid = true;
(void)Valid;