This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by mgrang on Mar 23 2018, 4:43 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 23 2018, 4:43 PM
rengolin requested changes to this revision.Mar 23 2018, 8:39 PM

I don't like this being on by default. I get it it uses EXPENSIVE_CHECKS, but still, most developers use Debug/Asserts builds.

I think it's fine to have the llvm::sort in tree, but the patches that make use of it should be local, as they're use for specific investigations.

Either that, or we replace *all* std::sort for llvm:sort and not just this one particular case.

This revision now requires changes to proceed.Mar 23 2018, 8:39 PM

I don't like this being on by default. I get it it uses EXPENSIVE_CHECKS, but still, most developers use Debug/Asserts builds.

I think it's fine to have the llvm::sort in tree, but the patches that make use of it should be local, as they're use for specific investigations.

Either that, or we replace *all* std::sort for llvm:sort and not just this one particular case.

This patch is one of a series of patches to replace *all* std::sort to llvm::sort in llvm/clang/polly (and other tools). I have a patch (https://reviews.llvm.org/D44363) which replaces all std::sort to llvm::sort. But as per review comments, it was suggested to break down that patch target-wise to smaller chunks. Hence I am now pushing smaller target-specific patches.

mgrang edited the summary of this revision. (Show Details)Mar 23 2018, 9:03 PM

Ping for review please.

rengolin accepted this revision.Apr 3 2018, 1:03 PM

This patch is one of a series of patches to replace *all* std::sort to llvm::sort in llvm/clang/polly (and other tools). I have a patch (https://reviews.llvm.org/D44363) which replaces all std::sort to llvm::sort. But as per review comments, it was suggested to break down that patch target-wise to smaller chunks. Hence I am now pushing smaller target-specific patches.

Right, those look to be the only two in the AArch64 back-end, LGTM. Sorry for the delay.

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