| Index: src/IceTargetLoweringX8632.cpp
|
| diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
|
| index 94e968722f692314b7cb03b0fccbb1c76976e784..7024d1447f21ea33c203c281b6e1cf23072b2f77 100644
|
| --- a/src/IceTargetLoweringX8632.cpp
|
| +++ b/src/IceTargetLoweringX8632.cpp
|
| @@ -239,6 +239,14 @@ void TargetDataX8632::emitConstantPool(GlobalContext *Ctx) {
|
| Str << "\t.section\t.rodata.cst" << Align << ",\"aM\",@progbits," << Align
|
| << "\n";
|
| Str << "\t.align\t" << Align << "\n";
|
| +
|
| + // 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);
|
| + });
|
| +
|
| for (Constant *C : Pool) {
|
| if (!C->getShouldBePooled())
|
| continue;
|
|
|