| Index: src/IceTargetLoweringX8664.cpp
|
| diff --git a/src/IceTargetLoweringX8664.cpp b/src/IceTargetLoweringX8664.cpp
|
| index 41d24cc8baf52dbc511347f626e32fc9ca5f8887..dcdb478e6e1e6987667dcfbda3c13eb0a4ef43fa 100644
|
| --- a/src/IceTargetLoweringX8664.cpp
|
| +++ b/src/IceTargetLoweringX8664.cpp
|
| @@ -743,10 +743,15 @@ void TargetDataX8664::emitConstantPool(GlobalContext *Ctx) {
|
|
|
| // If reorder-pooled-constants option is set to true, we need to shuffle the
|
| // constant pool before emitting it.
|
| - if (Ctx->getFlags().shouldReorderPooledConstants())
|
| - RandomShuffle(Pool.begin(), Pool.end(), [Ctx](uint64_t N) {
|
| - return (uint32_t)Ctx->getRNG().next(N);
|
| - });
|
| + if (Ctx->getFlags().shouldReorderPooledConstants()) {
|
| + // Use the constant's kind value as the salt for creating random number
|
| + // generator.
|
| + Operand::OperandKind K = (*Pool.begin())->getKind();
|
| + RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(),
|
| + RS_PooledConstantReordering, K);
|
| + RandomShuffle(Pool.begin(), Pool.end(),
|
| + [&RNG](uint64_t N) { return (uint32_t)RNG.next(N); });
|
| + }
|
|
|
| for (Constant *C : Pool) {
|
| if (!C->getShouldBePooled())
|
|
|