From dee50585e0ad099d9e60faec057d98240886a75b Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 6 May 2009 22:54:33 +0000 Subject: [PATCH] Use stable_sort instead of plain sort to avoid the risk of generating trivially different code on different hosts (due to differing std::sort implementations). llvm-svn: 71124 --- lib/Analysis/ScalarEvolution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 1b3aae87895..50cece03657 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -472,7 +472,7 @@ static void GroupByComplexity(std::vector &Ops) { } // Do the rough sort by complexity. - std::sort(Ops.begin(), Ops.end(), SCEVComplexityCompare()); + std::stable_sort(Ops.begin(), Ops.end(), SCEVComplexityCompare()); // Now that we are sorted by complexity, group elements of the same // complexity. Note that this is, at worst, N^2, but the vector is likely to