[shuffle] Stand back! I'm about to (try to) do math!
authorChandler Carruth <chandlerc@gmail.com>
Wed, 13 Aug 2014 12:27:18 +0000 (12:27 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 13 Aug 2014 12:27:18 +0000 (12:27 +0000)
commitadc58a657b8179c4dd4a5f97116a38d31decbcff
tree60352933d20ae85d5aead6567c524066dc3b8e7c
parent3c02eb1b9625c414957faebfb405beed21efbbd5
[shuffle] Stand back! I'm about to (try to) do math!

Especially with blends and large tree heights there was a problem with
the fuzzer where it would end up with enough undef shuffle elements in
enough parts of the tree that in a birthday-attack kind of way we ended
up regularly having large numbers of undef elements in the result. I was
seeing reasonably frequent cases of *all* results being undef which
prevents us from doing any correctness checking at all. While having
undef lanes is important, this was too much.

So I've tried to apply some math to the probabilities of having an undef
lane and balance them against the tree height. Please be gentle, I'm
really terrible at math. I probably made a bunch of amateur mistakes
here. Fixes, etc. are quite welcome. =D At least in running it some, it
seems to be producing more interesting (for correctness testing)
results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215540 91177308-0d34-0410-b5e6-96231b3b80d8
utils/shuffle_fuzz.py