[PATCH] D26718: [llvm] Iterate SmallPtrSet in reverse order to uncover non-determinism in codegen

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 11:40:16 PST 2016


Hash functions of *pointers* cannot be consistent in the face of ASLR.

But really, hash functions shouldn't be assumed to be consistent. They'll
be deterministic only within a single execution of the program. If we want
the freedom to change hash functions in the future we need people to not
rely on their particulars.

And even worse, hash *tables* are less consistent if you ever want to
change the rebucketing thresholds.

On Mon, Nov 28, 2016 at 10:57 AM Mehdi Amini <mehdi.amini at apple.com> wrote:

> Why is it “undefined"? I thought it is dependent on the order of insertion
> and the hash function, which should be deterministic and consistent.
>
>
> > On Nov 22, 2016, at 12:10 PM, Mandeep Singh Grang <mgrang at codeaurora.org>
> wrote:
> >
> > mgrang added a comment.
> >
> > Note: There are no associated tests with this patch as it is very
> difficult (not possible?) to detect "reverse" iteration since the relative
> order of elements in the SmallPtrSet is always undefined.
> > I would be happy to write tests for this if someone can suggest a good
> way of testing it. Otherwise the biggest test for this is to enable it in
> the buildbot and let the unit tests fail due to non-deterministic codegen.
> >
> >
> > Repository:
> >  rL LLVM
> >
> > https://reviews.llvm.org/D26718
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161128/318ba89a/attachment.html>


More information about the llvm-commits mailing list