This is an archive of the discontinued LLVM Phabricator instance.

[MC] Change std::sort to llvm::sort in response to r327219
ClosedPublic

Authored by mgrang on Mar 31 2018, 7:21 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

mgrang created this revision.Mar 31 2018, 7:21 PM

Ping for reviews please.

ruiu added a comment.Apr 9 2018, 1:33 PM

I'm not familiar with r327219, but if a decision to use randomized sort has been made, why don't you replace all occurrences of std::sort with llvm::sort in a single patch? I don't think that an author of each file don't have to understand this kind of change and approve individually.

mgrang added a comment.Apr 9 2018, 3:13 PM

I'm not familiar with r327219, but if a decision to use randomized sort has been made, why don't you replace all occurrences of std::sort with llvm::sort in a single patch? I don't think that an author of each file don't have to understand this kind of change and approve individually.

I had a patch to replace *all* occurrences of std::sort to llvm::sort https://reviews.llvm.org/D44363. However, the reviewers felt that the patch was getting too big and suggested splitting it into smaller patches target-wise, tablegen, MC, etc. Hence these separate patches.

ruiu accepted this revision.Apr 12 2018, 1:59 PM

LGTM

This revision is now accepted and ready to land.Apr 12 2018, 1:59 PM
This revision was automatically updated to reflect the committed changes.