[llvm-commits] [llvm] r71124 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Dan Gohman gohman at apple.com
Wed May 6 15:54:34 PDT 2009


Author: djg
Date: Wed May  6 17:54:33 2009
New Revision: 71124

URL: http://llvm.org/viewvc/llvm-project?rev=71124&view=rev
Log:
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).

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=71124&r1=71123&r2=71124&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed May  6 17:54:33 2009
@@ -472,7 +472,7 @@
   }
 
   // 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





More information about the llvm-commits mailing list