Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 61e5f25

Browse files
author
Mandeep Singh Grang
committed
[XCore] 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: dblaikie, RKSimon, robertlytton Reviewed By: robertlytton Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44875 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328564 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d15fdc6 commit 61e5f25

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Target/XCore/XCoreFrameLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static void GetSpillList(SmallVectorImpl<StackSlotInfo> &SpillList,
151151
Offset,
152152
FramePtr));
153153
}
154-
std::sort(SpillList.begin(), SpillList.end(), CompareSSIOffset);
154+
llvm::sort(SpillList.begin(), SpillList.end(), CompareSSIOffset);
155155
}
156156

157157
/// Creates an ordered list of EH info register 'spills'.
@@ -170,7 +170,7 @@ static void GetEHSpillList(SmallVectorImpl<StackSlotInfo> &SpillList,
170170
SpillList.push_back(
171171
StackSlotInfo(EHSlot[0], MFI.getObjectOffset(EHSlot[1]),
172172
TL->getExceptionSelectorRegister(PersonalityFn)));
173-
std::sort(SpillList.begin(), SpillList.end(), CompareSSIOffset);
173+
llvm::sort(SpillList.begin(), SpillList.end(), CompareSSIOffset);
174174
}
175175

176176
static MachineMemOperand *getFrameIndexMMO(MachineBasicBlock &MBB,

lib/Target/XCore/XCoreLowerThreadLocal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ createReplacementInstr(ConstantExpr *CE, Instruction *Instr) {
129129
static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) {
130130
do {
131131
SmallVector<WeakTrackingVH, 8> WUsers(CE->user_begin(), CE->user_end());
132-
std::sort(WUsers.begin(), WUsers.end());
132+
llvm::sort(WUsers.begin(), WUsers.end());
133133
WUsers.erase(std::unique(WUsers.begin(), WUsers.end()), WUsers.end());
134134
while (!WUsers.empty())
135135
if (WeakTrackingVH WU = WUsers.pop_back_val()) {

0 commit comments

Comments
 (0)