Skip to content

Commit f2e0f35

Browse files
feedback
Created using spr 1.3.7
1 parent ee84344 commit f2e0f35

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,10 @@ generateUnconstrainedCodeTemplates(const InstructionTemplate &Variant,
195195
}
196196

197197
std::mt19937 &randomGenerator() {
198-
unsigned RandomSeed = RandomGeneratorSeed;
199198
static std::random_device RandomDevice;
200-
if (RandomSeed == 0) {
201-
RandomSeed = RandomDevice();
202-
}
199+
unsigned RandomSeed = RandomGeneratorSeed.getNumOccurrences()
200+
? RandomGeneratorSeed
201+
: RandomDevice();
203202
LLVM_DEBUG(dbgs() << "Using random seed " << RandomSeed << ".\n");
204203
static std::mt19937 RandomGenerator(RandomSeed);
205204
return RandomGenerator;

0 commit comments

Comments
 (0)