| Index: src/IceTargetLoweringX86BaseImpl.h
|
| diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h
|
| index e190b5d0f4bf5b41c2114c9288db3cd426c685ed..a764dd9a3c1db7c25ec852a2a523c5c08f88f09e 100644
|
| --- a/src/IceTargetLoweringX86BaseImpl.h
|
| +++ b/src/IceTargetLoweringX86BaseImpl.h
|
| @@ -4132,10 +4132,11 @@ template <class Machine> void TargetX86Base<Machine>::doAddressOptLoad() {
|
| }
|
|
|
| template <class Machine>
|
| -void TargetX86Base<Machine>::randomlyInsertNop(float Probability) {
|
| - RandomNumberGeneratorWrapper RNG(Ctx->getRNG());
|
| - if (RNG.getTrueWithProbability(Probability)) {
|
| - _nop(RNG(Traits::X86_NUM_NOP_VARIANTS));
|
| +void TargetX86Base<Machine>::randomlyInsertNop(float Probability,
|
| + RandomNumberGenerator &RNG) {
|
| + RandomNumberGeneratorWrapper RNGW(RNG);
|
| + if (RNGW.getTrueWithProbability(Probability)) {
|
| + _nop(RNGW(Traits::X86_NUM_NOP_VARIANTS));
|
| }
|
| }
|
|
|
| @@ -5139,7 +5140,7 @@ Operand *TargetX86Base<Machine>::randomizeOrPoolImmediate(Constant *Immediate,
|
| Variable *Reg = makeReg(IceType_i32, RegNum);
|
| ConstantInteger32 *Integer = llvm::cast<ConstantInteger32>(Immediate);
|
| uint32_t Value = Integer->getValue();
|
| - uint32_t Cookie = Ctx->getRandomizationCookie();
|
| + uint32_t Cookie = Func->getConstantBlindingCookie();
|
| _mov(Reg, Ctx->getConstantInt(IceType_i32, Cookie + Value));
|
| Constant *Offset = Ctx->getConstantInt(IceType_i32, 0 - Cookie);
|
| _lea(Reg, Traits::X86OperandMem::create(Func, IceType_i32, Reg, Offset,
|
| @@ -5218,7 +5219,7 @@ TargetX86Base<Machine>::randomizeOrPoolImmediate(
|
| uint32_t Value =
|
| llvm::dyn_cast<ConstantInteger32>(MemOperand->getOffset())
|
| ->getValue();
|
| - uint32_t Cookie = Ctx->getRandomizationCookie();
|
| + uint32_t Cookie = Func->getConstantBlindingCookie();
|
| Constant *Mask1 = Ctx->getConstantInt(
|
| MemOperand->getOffset()->getType(), Cookie + Value);
|
| Constant *Mask2 =
|
|
|