From 1b9ff45157193d544d91c680701c9c3f00d786e5 Mon Sep 17 00:00:00 2001 From: Mandeep Singh Grang Date: Mon, 26 Mar 2018 18:08:26 +0000 Subject: [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 llvm-svn: 328564 --- llvm/lib/Target/XCore/XCoreFrameLowering.cpp | 4 ++-- llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/XCore/XCoreFrameLowering.cpp b/llvm/lib/Target/XCore/XCoreFrameLowering.cpp index 62b2c8eee15..a5fe63b2829 100644 --- a/llvm/lib/Target/XCore/XCoreFrameLowering.cpp +++ b/llvm/lib/Target/XCore/XCoreFrameLowering.cpp @@ -151,7 +151,7 @@ static void GetSpillList(SmallVectorImpl &SpillList, 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(SmallVectorImpl &SpillList, 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, diff --git a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp index 87532d11ede..666b3870fb8 100644 --- a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp +++ b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp @@ -129,7 +129,7 @@ createReplacementInstr(ConstantExpr *CE, Instruction *Instr) { static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) { do { SmallVector 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()) { -- cgit v1.2.3