[PATCH] D121870: Use a stable-sort when combining bases

Sterling Augustine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 09:04:17 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG81417261a15f: Use a stable-sort when combining bases (authored by saugustine).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121870/new/

https://reviews.llvm.org/D121870

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp


Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -15977,10 +15977,10 @@
   // Try to fold with other users. Non-constant updates are considered
   // first, and constant updates are sorted to not break a sequence of
   // strided accesses (if there is any).
-  std::sort(BaseUpdates.begin(), BaseUpdates.end(),
-            [](BaseUpdateUser &LHS, BaseUpdateUser &RHS) {
-              return LHS.ConstInc < RHS.ConstInc;
-            });
+  std::stable_sort(BaseUpdates.begin(), BaseUpdates.end(),
+                   [](BaseUpdateUser &LHS, BaseUpdateUser &RHS) {
+                     return LHS.ConstInc < RHS.ConstInc;
+                   });
   for (BaseUpdateUser &User : BaseUpdates) {
     if (TryCombineBaseUpdate(Target, User, /*SimpleConstIncOnly=*/false, DCI))
       return SDValue();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121870.416200.patch
Type: text/x-patch
Size: 956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220317/48c689f9/attachment.bin>


More information about the llvm-commits mailing list