Skip to content

Commit 68a151a

Browse files
author
Mandeep Singh Grang
committedApr 8, 2018
[X86] 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: chandlerc, craig.topper, RKSimon Reviewed By: chandlerc, craig.topper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44874 llvm-svn: 329534
1 parent ac5abbf commit 68a151a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎llvm/lib/Target/X86/X86ISelLowering.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -11679,11 +11679,11 @@ static SDValue lowerV8I16GeneralSingleInputVectorShuffle(
1167911679

1168011680
SmallVector<int, 4> LoInputs;
1168111681
copy_if(LoMask, std::back_inserter(LoInputs), [](int M) { return M >= 0; });
11682-
std::sort(LoInputs.begin(), LoInputs.end());
11682+
array_pod_sort(LoInputs.begin(), LoInputs.end());
1168311683
LoInputs.erase(std::unique(LoInputs.begin(), LoInputs.end()), LoInputs.end());
1168411684
SmallVector<int, 4> HiInputs;
1168511685
copy_if(HiMask, std::back_inserter(HiInputs), [](int M) { return M >= 0; });
11686-
std::sort(HiInputs.begin(), HiInputs.end());
11686+
array_pod_sort(HiInputs.begin(), HiInputs.end());
1168711687
HiInputs.erase(std::unique(HiInputs.begin(), HiInputs.end()), HiInputs.end());
1168811688
int NumLToL =
1168911689
std::lower_bound(LoInputs.begin(), LoInputs.end(), 4) - LoInputs.begin();
@@ -12486,12 +12486,12 @@ static SDValue lowerV16I8VectorShuffle(const SDLoc &DL, ArrayRef<int> Mask,
1248612486
SmallVector<int, 4> LoInputs;
1248712487
copy_if(Mask, std::back_inserter(LoInputs),
1248812488
[](int M) { return M >= 0 && M < 8; });
12489-
std::sort(LoInputs.begin(), LoInputs.end());
12489+
array_pod_sort(LoInputs.begin(), LoInputs.end());
1249012490
LoInputs.erase(std::unique(LoInputs.begin(), LoInputs.end()),
1249112491
LoInputs.end());
1249212492
SmallVector<int, 4> HiInputs;
1249312493
copy_if(Mask, std::back_inserter(HiInputs), [](int M) { return M >= 8; });
12494-
std::sort(HiInputs.begin(), HiInputs.end());
12494+
array_pod_sort(HiInputs.begin(), HiInputs.end());
1249512495
HiInputs.erase(std::unique(HiInputs.begin(), HiInputs.end()),
1249612496
HiInputs.end());
1249712497

0 commit comments

Comments
 (0)
Please sign in to comment.