Commit Graph

7 Commits

Author SHA1 Message Date
Chandler Carruth
120b4c6a41 [shuffle] Teach the shufflevector fuzzer to support fixed element types.
I'm using this to try to find more minimal test cases by re-fuzzing
within a specific domain once errors are found.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215823 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-17 00:40:31 +00:00
Chandler Carruth
adc58a657b [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
2014-08-13 12:27:18 +00:00
Chandler Carruth
ba20fb11a7 [shuffle] Make the seed an optional component and add support for
letting the python very directly compute a UUID.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215533 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13 10:00:46 +00:00
Chandler Carruth
918801162a [shuffle] Teach the shuffle fuzzer to fuzz blends, including forming
a tree of inputs to blend iteratively together.

This required a pretty substantial rewrite of the innards. The number of
shuffle instructions is now bounded in terms of tree-height. There is
a flag to disable blends so that its still possible to test single input
shuffles. I've also improved various aspects of how the test program is
generated, primarily to simplify the test harness and allow some
optimizations to clean up how we actually check the results and build up
the inputs.

Again, apologies for my likely horrible use of Python... But hey, it
works! (Ish?)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215530 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13 09:05:59 +00:00
Chandler Carruth
08cfa8c155 [shuffle] Tweak the shuffle fuzzer to support bigger seeds. I'm
currently using UUIDs to seed this in order to scan a bigger range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215521 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13 03:21:11 +00:00
Chandler Carruth
792202d090 Add an option to the shuffle fuzzer that lets you fuzz exclusively
within a single bit-width of vectors. This is particularly useful for
when you know you have bugs in a certain area and want to find simpler
test cases than those produced by an open-ended fuzzing that ends up
legalizing the vector in addition to shuffling it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215056 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 04:49:54 +00:00
Chandler Carruth
81dfaefc4c Add a vector shuffle fuzzer.
This is a python script which for a given seed generates a random
sequence of random shuffles of a random vector width. It embeds this
into a function and emits a main function which calls the test routine
and checks that the results (where defined) match the obvious results.

I'll be using this to drive out miscompiles from the new vector shuffle
logic now that it is clean of any crashes I can find with llvm-stress.

Note, my python skills are very poor. Sorry if this is terrible code,
and feel free to tell me how I should write this or just patch it as
necessary.

The tests generated try to be very portable and use boring C routines.
It technically will mis-declare the C routines and pass 32-bit integers
to parametrs that expect 64-bit integers. If someone wants to fix this
and has less terrible ideas of how to do it, I'm all ears. Fortunately,
this "just works" for x86. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215054 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 04:13:51 +00:00