[PATCH] D44873: [WebAssembly] Change std::sort to llvm::sort in response to r327219

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 9 12:41:42 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL329607: [WebAssembly] Change std::sort to llvm::sort in response to r327219 (authored by mgrang, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D44873?vs=139724&id=141716#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D44873

Files:
  llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp


Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp
@@ -118,16 +118,16 @@
   // registers), by weight next, and then by position.
   // TODO: Investigate more intelligent sorting heuristics. For starters, we
   // should try to coalesce adjacent live intervals before non-adjacent ones.
-  std::sort(SortedIntervals.begin(), SortedIntervals.end(),
-            [MRI](LiveInterval *LHS, LiveInterval *RHS) {
-              if (MRI->isLiveIn(LHS->reg) != MRI->isLiveIn(RHS->reg))
-                return MRI->isLiveIn(LHS->reg);
-              if (LHS->weight != RHS->weight)
-                return LHS->weight > RHS->weight;
-              if (LHS->empty() || RHS->empty())
-                return !LHS->empty() && RHS->empty();
-              return *LHS < *RHS;
-            });
+  llvm::sort(SortedIntervals.begin(), SortedIntervals.end(),
+             [MRI](LiveInterval *LHS, LiveInterval *RHS) {
+               if (MRI->isLiveIn(LHS->reg) != MRI->isLiveIn(RHS->reg))
+                 return MRI->isLiveIn(LHS->reg);
+               if (LHS->weight != RHS->weight)
+                 return LHS->weight > RHS->weight;
+               if (LHS->empty() || RHS->empty())
+                 return !LHS->empty() && RHS->empty();
+               return *LHS < *RHS;
+             });
 
   DEBUG(dbgs() << "Coloring register intervals:\n");
   SmallVector<unsigned, 16> SlotMapping(SortedIntervals.size(), -1u);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44873.141716.patch
Type: text/x-patch
Size: 1626 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180409/0e182e45/attachment.bin>


More information about the llvm-commits mailing list