[llvm] r329216 - [AArch64] Change std::sort to llvm::sort in response to r327219

Mandeep Singh Grang via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 11:20:28 PDT 2018


Author: mgrang
Date: Wed Apr  4 11:20:28 2018
New Revision: 329216

URL: http://llvm.org/viewvc/llvm-project?rev=329216&view=rev
Log:
[AArch64] 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: t.p.northover, jmolloy, RKSimon, rengolin

Reviewed By: rengolin

Subscribers: dexonsmith, rengolin, javed.absar, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D44853

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp

Modified: llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp?rev=329216&r1=329215&r2=329216&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp Wed Apr  4 11:20:28 2018
@@ -375,9 +375,9 @@ bool AArch64A57FPLoadBalancing::runOnBas
 
   // Now we have a set of sets, order them by start address so
   // we can iterate over them sequentially.
-  std::sort(V.begin(), V.end(),
-            [](const std::vector<Chain*> &A,
-               const std::vector<Chain*> &B) {
+  llvm::sort(V.begin(), V.end(),
+             [](const std::vector<Chain*> &A,
+                const std::vector<Chain*> &B) {
       return A.front()->startsBefore(B.front());
     });
 
@@ -451,7 +451,7 @@ bool AArch64A57FPLoadBalancing::colorCha
   // change them to!
   // Final tie-break with instruction order so pass output is stable (i.e. not
   // dependent on malloc'd pointer values).
-  std::sort(GV.begin(), GV.end(), [](const Chain *G1, const Chain *G2) {
+  llvm::sort(GV.begin(), GV.end(), [](const Chain *G1, const Chain *G2) {
       if (G1->size() != G2->size())
         return G1->size() > G2->size();
       if (G1->requiresFixup() != G2->requiresFixup())




More information about the llvm-commits mailing list