Lines Matching full:random
1 //===- llvm-stress.cpp - Generate random LL files to stress-test LLVM -----===//
9 // This program is a utility that generates random .ll files to stress-test
82 /// A utility class to provide a pseudo-random number generator which is
86 class Random {
89 Random(unsigned _seed):Seed(_seed) {}
91 /// Return a random integer, up to a
96 // Only lowest 19 bits are random-ish.
100 /// Return a random 64 bit integer.
114 /// Make this like a C++11 random device
122 assert(Val <= max() && "Random value out of range");
152 /// modifying and adding new random instructions.
159 Modifier(BasicBlock *Block, PieceTable *PT, Random *R)
206 /// Return a random integer.
211 /// Return a random value from the list of known values.
230 /// Return a random value with a known type.
261 /// Return a random value of any pointer type.
272 /// Return a random value of any vector type.
283 /// Pick a random type.
288 /// Pick a random pointer type.
294 /// Pick a random vector type.
310 // Pick a random vector width in the range 2**0 to 2**4.
317 /// Pick a random scalar type.
328 /// Random number generator
329 Random *Ran;
338 LoadModifier(BasicBlock *BB, PieceTable *PT, Random *R)
351 StoreModifier(BasicBlock *BB, PieceTable *PT, Random *R)
370 BinModifier(BasicBlock *BB, PieceTable *PT, Random *R)
414 ConstModifier(BasicBlock *BB, PieceTable *PT, Random *R)
431 // Generate 128 random bits, the size of the (currently)
465 AllocaModifier(BasicBlock *BB, PieceTable *PT, Random *R)
477 ExtractElementModifier(BasicBlock *BB, PieceTable *PT, Random *R)
491 ShuffModifier(BasicBlock *BB, PieceTable *PT, Random *R)
523 InsertElementModifier(BasicBlock *BB, PieceTable *PT, Random *R)
539 CastModifier(BasicBlock *BB, PieceTable *PT, Random *R)
617 SelectModifier(BasicBlock *BB, PieceTable *PT, Random *R)
640 CmpModifier(BasicBlock *BB, PieceTable *PT, Random *R)
670 static void FillFunction(Function *F, Random &R) {
682 // List of modifiers which add new random instructions.
695 // Generate the random instructions
706 static void IntroduceControlFlow(Function *F, Random &R) {
741 Random R(SeedCL);
742 // Generate lots of random instructions inside a single basic block.