[PATCH] D39245: [ADT] Shuffle containers before sorting to uncover non-deterministic behavior

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 13:37:36 PDT 2017


On Tue, Oct 24, 2017 at 1:27 PM Grang, Mandeep Singh <mgrang at codeaurora.org>
wrote:

> Vedant,
>
> I am not sure if stable_sort is the correct solution in r316490. Try
> calling std::random_shuffle before you do std::stable_sort for
> InstantiationSubViews in SourceCoverageView.cpp and you will still see
> the two llvm-cov tests failing.
>

random_shuffle+stable_sort doesn't seem like a test that's necessary to
pass, unless I'm missing something.

stable_sort would be used somewhere where the input order is already well
defined (so shuffling it wouldn't simulate expected program behavior).


>
> I guess the problem is that InstantiationSubViews is filled from an
> unordered container and the input order itself is undefined. So
> stable_sort won't help in this case.
>
> --Mandeep
>
>
> On 10/24/2017 1:04 PM, Vedant Kumar via Phabricator wrote:
> > vsk added a comment.
> >
> > @mgrang thanks, should be fixed in r316490.
> >
> >
> > Repository:
> >    rL LLVM
> >
> > https://reviews.llvm.org/D39245
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171024/085b7ef3/attachment.html>


More information about the llvm-commits mailing list