Lines Matching defs:Random
1 //===-- llvm-stress.cpp - Generate random LL files to stress-test LLVM ----===//
10 // This program is a utility that generates random .ll files to stress-test
80 /// A utility class to provide a pseudo-random number generator which is
84 class Random {
87 Random(unsigned _seed):Seed(_seed) {}
89 /// Return a random integer, up to a
94 // Only lowest 19 bits are random-ish.
98 /// Return a random 32 bit integer.
105 /// Return a random 64 bit integer.
142 /// modifying and adding new random instructions.
149 Modifier(BasicBlock *Block, PieceTable *PT, Random *R):
164 /// Return a random value from the list of known values.
183 /// Return a random value with a known type.
216 /// Return a random value of any pointer type.
227 /// Return a random value of any vector type.
238 /// Pick a random type.
243 /// Pick a random pointer type.
249 /// Pick a random vector type.
251 // Pick a random vector width in the range 2**0 to 2**4.
267 /// Pick a random scalar type.
291 /// Random number generator
292 Random *Ran;
298 LoadModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
308 StoreModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
326 BinModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
370 ConstModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
384 // Generate 128 random bits, the size of the (currently)
416 AllocaModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R){}
425 ExtractElementModifier(BasicBlock *BB, PieceTable *PT, Random *R):
439 ShuffModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
466 InsertElementModifier(BasicBlock *BB, PieceTable *PT, Random *R):
483 CastModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
568 SelectModifier(BasicBlock *BB, PieceTable *PT, Random *R):
593 CmpModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
622 static void FillFunction(Function *F, Random &R) {
634 // List of modifiers which add new random instructions.
647 // Generate the random instructions
658 static void IntroduceControlFlow(Function *F, Random &R) {
693 Random R(SeedCL);
694 // Generate lots of random instructions inside a single basic block.