[PATCH] D19422: [RewriteStatepointsForGC] Use more stable ordering for statepoint arguments

Igor Laevsky via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 11:19:14 PDT 2016


igor-laevsky created this revision.
igor-laevsky added a reviewer: sanjoy.
igor-laevsky added a subscriber: llvm-commits.

When sorting statepoint arguments we can use more precise ordering. This will result in a more rare non-deterministic results from this pass.

http://reviews.llvm.org/D19422

Files:
  lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Index: lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
===================================================================
--- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -1536,7 +1536,7 @@
 
   std::sort(NameOrdering.begin(), NameOrdering.end(),
             [](const BaseDerivedPair &L, const BaseDerivedPair &R) {
-              return L.Derived->getName() < R.Derived->getName();
+              return order_by_name(L.Derived, R.Derived);
             });
 
   for (size_t i = 0; i < BaseVec.size(); i++) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19422.54680.patch
Type: text/x-patch
Size: 576 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160422/142bb4b2/attachment.bin>


More information about the llvm-commits mailing list