[llvm] r328564 - [XCore] Change std::sort to llvm::sort in response to r327219
Mandeep Singh Grang via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 26 11:08:26 PDT 2018
Author: mgrang
Date: Mon Mar 26 11:08:26 2018
New Revision: 328564
URL: http://llvm.org/viewvc/llvm-project?rev=328564&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp
llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp
Modified: llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp?rev=328564&r1=328563&r2=328564&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp Mon Mar 26 11:08:26 2018
@@ -151,7 +151,7 @@ static void GetSpillList(SmallVectorImpl
Offset,
FramePtr));
}
- std::sort(SpillList.begin(), SpillList.end(), CompareSSIOffset);
+ llvm::sort(SpillList.begin(), SpillList.end(), CompareSSIOffset);
}
/// Creates an ordered list of EH info register 'spills'.
@@ -170,7 +170,7 @@ static void GetEHSpillList(SmallVectorIm
SpillList.push_back(
StackSlotInfo(EHSlot[0], MFI.getObjectOffset(EHSlot[1]),
TL->getExceptionSelectorRegister(PersonalityFn)));
- std::sort(SpillList.begin(), SpillList.end(), CompareSSIOffset);
+ llvm::sort(SpillList.begin(), SpillList.end(), CompareSSIOffset);
}
static MachineMemOperand *getFrameIndexMMO(MachineBasicBlock &MBB,
Modified: llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp?rev=328564&r1=328563&r2=328564&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp Mon Mar 26 11:08:26 2018
@@ -129,7 +129,7 @@ createReplacementInstr(ConstantExpr *CE,
static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) {
do {
SmallVector<WeakTrackingVH, 8> WUsers(CE->user_begin(), CE->user_end());
- std::sort(WUsers.begin(), WUsers.end());
+ llvm::sort(WUsers.begin(), WUsers.end());
WUsers.erase(std::unique(WUsers.begin(), WUsers.end()), WUsers.end());
while (!WUsers.empty())
if (WeakTrackingVH WU = WUsers.pop_back_val()) {
More information about the llvm-commits
mailing list