Skip to content

Commit ad060df

Browse files
[BOLT] Use llvm::stable_sort (NFC) (#140429)
1 parent 465e0da commit ad060df

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

bolt/lib/Passes/ShrinkWrapping.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -825,14 +825,13 @@ void ShrinkWrapping::computeSaveLocations() {
825825
if (!CSA.CalleeSaved[I])
826826
continue;
827827

828-
std::stable_sort(BestSavePos[I].begin(), BestSavePos[I].end(),
829-
[&](const MCInst *A, const MCInst *B) {
830-
const BinaryBasicBlock *BBA = InsnToBB[A];
831-
const BinaryBasicBlock *BBB = InsnToBB[B];
832-
const uint64_t CountA = BBA->getKnownExecutionCount();
833-
const uint64_t CountB = BBB->getKnownExecutionCount();
834-
return CountB < CountA;
835-
});
828+
llvm::stable_sort(BestSavePos[I], [&](const MCInst *A, const MCInst *B) {
829+
const BinaryBasicBlock *BBA = InsnToBB[A];
830+
const BinaryBasicBlock *BBB = InsnToBB[B];
831+
const uint64_t CountA = BBA->getKnownExecutionCount();
832+
const uint64_t CountB = BBB->getKnownExecutionCount();
833+
return CountB < CountA;
834+
});
836835

837836
for (MCInst *Pos : BestSavePos[I]) {
838837
const BinaryBasicBlock *BB = InsnToBB[Pos];

0 commit comments

Comments
 (0)