<div dir="ltr"><div>Hash functions of *pointers* cannot be consistent in the face of ASLR.</div><div><br></div>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.<div><br></div><div>And even worse, hash *tables* are less consistent if you ever want to change the rebucketing thresholds.</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 28, 2016 at 10:57 AM Mehdi Amini <<a href="mailto:mehdi.amini@apple.com">mehdi.amini@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why is it “undefined"? I thought it is dependent on the order of insertion and the hash function, which should be deterministic and consistent.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
> On Nov 22, 2016, at 12:10 PM, Mandeep Singh Grang <<a href="mailto:mgrang@codeaurora.org" class="gmail_msg" target="_blank">mgrang@codeaurora.org</a>> wrote:<br class="gmail_msg">
><br class="gmail_msg">
> mgrang added a comment.<br class="gmail_msg">
><br class="gmail_msg">
> 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.<br class="gmail_msg">
> 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.<br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
> Repository:<br class="gmail_msg">
>  rL LLVM<br class="gmail_msg">
><br class="gmail_msg">
> <a href="https://reviews.llvm.org/D26718" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D26718</a><br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>