[PATCH] D39630: [PredicateInfo] Stable sort ValueDFS to remove non-deterministic ordering

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 10:22:58 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL318165: [PredicateInfo] Stable sort ValueDFS to remove non-deterministic ordering (authored by mgrang).

Changed prior to commit:
  https://reviews.llvm.org/D39630?vs=121612&id=122869#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39630

Files:
  llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp


Index: llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp
+++ llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp
@@ -611,7 +611,7 @@
     }
 
     convertUsesToDFSOrdered(Op, OrderedUses);
-    std::sort(OrderedUses.begin(), OrderedUses.end(), Compare);
+    std::stable_sort(OrderedUses.begin(), OrderedUses.end(), Compare);
     SmallVector<ValueDFS, 8> RenameStack;
     // For each use, sorted into dfs order, push values and replaces uses with
     // top of stack, which will represent the reaching def.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39630.122869.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171114/13c9d707/attachment.bin>


More information about the llvm-commits mailing list