[PATCH] D44856: [AMDGPU] Change std::sort to llvm::sort in response to r327219

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 23 17:17:00 PDT 2018


mgrang created this revision.
mgrang added reviewers: tstellar, RKSimon.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, kzhuravl, arsenm.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D44856

Files:
  lib/Target/AMDGPU/GCNIterativeScheduler.cpp


Index: lib/Target/AMDGPU/GCNIterativeScheduler.cpp
===================================================================
--- lib/Target/AMDGPU/GCNIterativeScheduler.cpp
+++ lib/Target/AMDGPU/GCNIterativeScheduler.cpp
@@ -433,7 +433,7 @@
 // Sort recorded regions by pressure - highest at the front
 void GCNIterativeScheduler::sortRegionsByPressure(unsigned TargetOcc) {
   const auto &ST = MF.getSubtarget<SISubtarget>();
-  std::sort(Regions.begin(), Regions.end(),
+  llvm::sort(Regions.begin(), Regions.end(),
     [&ST, TargetOcc](const Region *R1, const Region *R2) {
     return R2->MaxPressure.less(ST, R1->MaxPressure, TargetOcc);
   });


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44856.139680.patch
Type: text/x-patch
Size: 645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180324/684ba0d0/attachment.bin>


More information about the llvm-commits mailing list