[llvm] r211705 - Random Number Generator (llvm)
Chris Lattner
clattner at apple.com
Wed Jul 2 17:38:04 PDT 2014
On Jul 2, 2014, at 1:27 PM, Nick Lewycky <nlewycky at google.com> wrote:
> On 2 July 2014 11:52, Chandler Carruth <chandlerc at google.com> wrote:
>
> On Tue, Jul 1, 2014 at 9:50 PM, Chris Lattner <clattner at apple.com> wrote:
> Any thoughts guys? If we are unclear what the right design here is, I'd prefer you to revert the patch until it is figured out.
>
> I'm moderately confident this isn't the right design...
>
> Specifically, I totally get why the seed and salt data needed by an RNG might be in the module (preferably opaquely in module-level metadata or something), but I don't really understand why the RN*G* would be in the module rather than in the pass or thing which is generating the random data for some purpose.
>
> Chandler and I just had a talk about this and formed some amount of consensus that I want to relay to the list.
>
> The RNG should have a seed in the module that we can use to create the RNG as needed. For predictability we agreed on MT19937 which has a lot of good properties (well-balanced, doesn't have a warmup period, etc). Module-level metadata works well for storing the seed.
>
> Stephen and Chris, does this work for both of you? Are the motivations behind this design clear?
Storing this as module-level metadata makes sense to me.
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140702/b084de6f/attachment.html>
More information about the llvm-commits
mailing list