Skip to content

Commit bd38234

Browse files
Reland "Use a stable-sort when combining bases"
Differential Revision: https://reviews.llvm.org/D121922
1 parent d0af427 commit bd38234

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15977,10 +15977,10 @@ static SDValue CombineBaseUpdate(SDNode *N,
1597715977
// Try to fold with other users. Non-constant updates are considered
1597815978
// first, and constant updates are sorted to not break a sequence of
1597915979
// strided accesses (if there is any).
15980-
std::sort(BaseUpdates.begin(), BaseUpdates.end(),
15981-
[](BaseUpdateUser &LHS, BaseUpdateUser &RHS) {
15982-
return LHS.ConstInc < RHS.ConstInc;
15983-
});
15980+
std::stable_sort(BaseUpdates.begin(), BaseUpdates.end(),
15981+
[](const BaseUpdateUser &LHS, const BaseUpdateUser &RHS) {
15982+
return LHS.ConstInc < RHS.ConstInc;
15983+
});
1598415984
for (BaseUpdateUser &User : BaseUpdates) {
1598515985
if (TryCombineBaseUpdate(Target, User, /*SimpleConstIncOnly=*/false, DCI))
1598615986
return SDValue();

0 commit comments

Comments
 (0)