OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// | 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 Reg = Func->makeVariable(Ty); | 775 Reg = Func->makeVariable(Ty); |
776 Reg->setRegNum(RegNum); | 776 Reg->setRegNum(RegNum); |
777 PhysicalRegisters[Ty][RegNum] = Reg; | 777 PhysicalRegisters[Ty][RegNum] = Reg; |
778 // Specially mark a named physical register as an "argument" so that it is | 778 // Specially mark a named physical register as an "argument" so that it is |
779 // considered live upon function entry. Otherwise it's possible to get | 779 // considered live upon function entry. Otherwise it's possible to get |
780 // liveness validation errors for saving callee-save registers. | 780 // liveness validation errors for saving callee-save registers. |
781 Func->addImplicitArg(Reg); | 781 Func->addImplicitArg(Reg); |
782 // Don't bother tracking the live range of a named physical register. | 782 // Don't bother tracking the live range of a named physical register. |
783 Reg->setIgnoreLiveness(); | 783 Reg->setIgnoreLiveness(); |
784 } | 784 } |
| 785 assert(Traits::getGprForType(Ty, RegNum) == static_cast<int32_t>(RegNum)); |
785 return Reg; | 786 return Reg; |
786 } | 787 } |
787 | 788 |
788 template <class Machine> | 789 template <class Machine> |
789 IceString TargetX86Base<Machine>::getRegName(SizeT RegNum, Type) const { | 790 IceString TargetX86Base<Machine>::getRegName(SizeT RegNum, Type Ty) const { |
790 return Traits::getRegName(RegNum); | 791 return Traits::getRegName(Traits::getGprForType(Ty, RegNum)); |
791 } | 792 } |
792 | 793 |
793 template <class Machine> | 794 template <class Machine> |
794 void TargetX86Base<Machine>::emitVariable(const Variable *Var) const { | 795 void TargetX86Base<Machine>::emitVariable(const Variable *Var) const { |
795 if (!BuildDefs::dump()) | 796 if (!BuildDefs::dump()) |
796 return; | 797 return; |
797 Ostream &Str = Ctx->getStrEmit(); | 798 Ostream &Str = Ctx->getStrEmit(); |
798 if (Var->hasReg()) { | 799 if (Var->hasReg()) { |
799 Str << "%" << getRegName(Var->getRegNum(), Var->getType()); | 800 Str << "%" << getRegName(Var->getRegNum(), Var->getType()); |
800 return; | 801 return; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 std::max(AlignmentParam, Traits::X86_STACK_ALIGNMENT_BYTES); | 988 std::max(AlignmentParam, Traits::X86_STACK_ALIGNMENT_BYTES); |
988 const bool OverAligned = Alignment > Traits::X86_STACK_ALIGNMENT_BYTES; | 989 const bool OverAligned = Alignment > Traits::X86_STACK_ALIGNMENT_BYTES; |
989 const bool OptM1 = Ctx->getFlags().getOptLevel() == Opt_m1; | 990 const bool OptM1 = Ctx->getFlags().getOptLevel() == Opt_m1; |
990 const bool AllocaWithKnownOffset = Inst->getKnownFrameOffset(); | 991 const bool AllocaWithKnownOffset = Inst->getKnownFrameOffset(); |
991 const bool UseFramePointer = | 992 const bool UseFramePointer = |
992 hasFramePointer() || OverAligned || !AllocaWithKnownOffset || OptM1; | 993 hasFramePointer() || OverAligned || !AllocaWithKnownOffset || OptM1; |
993 | 994 |
994 if (UseFramePointer) | 995 if (UseFramePointer) |
995 setHasFramePointer(); | 996 setHasFramePointer(); |
996 | 997 |
997 Variable *esp = getPhysicalRegister(getStackReg()); | 998 Variable *esp = getPhysicalRegister(getStackReg(), Traits::WordType); |
998 if (OverAligned) { | 999 if (OverAligned) { |
999 _and(esp, Ctx->getConstantInt32(-Alignment)); | 1000 _and(esp, Ctx->getConstantInt32(-Alignment)); |
1000 } | 1001 } |
1001 | 1002 |
1002 Variable *Dest = Inst->getDest(); | 1003 Variable *Dest = Inst->getDest(); |
1003 Operand *TotalSize = legalize(Inst->getSizeInBytes()); | 1004 Operand *TotalSize = legalize(Inst->getSizeInBytes()); |
1004 | 1005 |
1005 if (const auto *ConstantTotalSize = | 1006 if (const auto *ConstantTotalSize = |
1006 llvm::dyn_cast<ConstantInteger32>(TotalSize)) { | 1007 llvm::dyn_cast<ConstantInteger32>(TotalSize)) { |
1007 const uint32_t Value = | 1008 const uint32_t Value = |
1008 Utils::applyAlignment(ConstantTotalSize->getValue(), Alignment); | 1009 Utils::applyAlignment(ConstantTotalSize->getValue(), Alignment); |
1009 if (!UseFramePointer) { | 1010 if (!UseFramePointer) { |
1010 // If we don't need a Frame Pointer, this alloca has a known offset to the | 1011 // If we don't need a Frame Pointer, this alloca has a known offset to the |
1011 // stack pointer. We don't need adjust the stack pointer, nor assign any | 1012 // stack pointer. We don't need adjust the stack pointer, nor assign any |
1012 // value to Dest, as Dest is rematerializable. | 1013 // value to Dest, as Dest is rematerializable. |
1013 assert(Dest->isRematerializable()); | 1014 assert(Dest->isRematerializable()); |
1014 FixedAllocaSizeBytes += Value; | 1015 FixedAllocaSizeBytes += Value; |
1015 Context.insert<InstFakeDef>(Dest); | 1016 Context.insert<InstFakeDef>(Dest); |
1016 } else { | 1017 } else { |
1017 _sub(esp, Ctx->getConstantInt32(Value)); | 1018 _sub(esp, Ctx->getConstantInt32(Value)); |
1018 } | 1019 } |
1019 } else { | 1020 } else { |
1020 // Non-constant sizes need to be adjusted to the next highest multiple of | 1021 // Non-constant sizes need to be adjusted to the next highest multiple of |
1021 // the required alignment at runtime. | 1022 // the required alignment at runtime. |
1022 Variable *T = makeReg(IceType_i32); | 1023 Variable *T = makeReg(Traits::WordType); |
1023 _mov(T, TotalSize); | 1024 if (Traits::Is64Bit && TotalSize->getType() != IceType_i64) { |
| 1025 _movzx(T, TotalSize); |
| 1026 } else { |
| 1027 _mov(T, TotalSize); |
| 1028 } |
1024 _add(T, Ctx->getConstantInt32(Alignment - 1)); | 1029 _add(T, Ctx->getConstantInt32(Alignment - 1)); |
1025 _and(T, Ctx->getConstantInt32(-Alignment)); | 1030 _and(T, Ctx->getConstantInt32(-Alignment)); |
1026 _sub(esp, T); | 1031 _sub(esp, T); |
1027 } | 1032 } |
1028 // Add enough to the returned address to account for the out args area. | 1033 // Add enough to the returned address to account for the out args area. |
1029 uint32_t OutArgsSize = maxOutArgsSizeBytes(); | 1034 uint32_t OutArgsSize = maxOutArgsSizeBytes(); |
1030 if (OutArgsSize > 0) { | 1035 if (OutArgsSize > 0) { |
1031 Variable *T = makeReg(IceType_i32); | 1036 Variable *T = makeReg(IceType_i32); |
1032 typename Traits::X86OperandMem *CalculateOperand = | 1037 typename Traits::X86OperandMem *CalculateOperand = |
1033 Traits::X86OperandMem::create( | 1038 Traits::X86OperandMem::create( |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 // immediates as the operand. | 1715 // immediates as the operand. |
1711 Src1 = legalize(Src1, Legal_Reg | Legal_Mem); | 1716 Src1 = legalize(Src1, Legal_Reg | Legal_Mem); |
1712 uint32_t Eax; | 1717 uint32_t Eax; |
1713 uint32_t Edx; | 1718 uint32_t Edx; |
1714 switch (Ty) { | 1719 switch (Ty) { |
1715 default: | 1720 default: |
1716 llvm::report_fatal_error("Bad type for udiv"); | 1721 llvm::report_fatal_error("Bad type for udiv"); |
1717 case IceType_i64: | 1722 case IceType_i64: |
1718 Eax = Traits::getRaxOrDie(); | 1723 Eax = Traits::getRaxOrDie(); |
1719 Edx = Traits::getRdxOrDie(); | 1724 Edx = Traits::getRdxOrDie(); |
| 1725 break; |
1720 case IceType_i32: | 1726 case IceType_i32: |
1721 Eax = Traits::RegisterSet::Reg_eax; | 1727 Eax = Traits::RegisterSet::Reg_eax; |
1722 Edx = Traits::RegisterSet::Reg_edx; | 1728 Edx = Traits::RegisterSet::Reg_edx; |
1723 break; | 1729 break; |
1724 case IceType_i16: | 1730 case IceType_i16: |
1725 Eax = Traits::RegisterSet::Reg_ax; | 1731 Eax = Traits::RegisterSet::Reg_ax; |
1726 Edx = Traits::RegisterSet::Reg_dx; | 1732 Edx = Traits::RegisterSet::Reg_dx; |
1727 break; | 1733 break; |
1728 case IceType_i8: | 1734 case IceType_i8: |
1729 Eax = Traits::RegisterSet::Reg_al; | 1735 Eax = Traits::RegisterSet::Reg_al; |
1730 Edx = Traits::RegisterSet::Reg_ah; | 1736 Edx = Traits::RegisterSet::Reg_ah; |
1731 break; | 1737 break; |
1732 } | 1738 } |
| 1739 T_edx = makeReg(Ty, Edx); |
1733 _mov(T, Src0, Eax); | 1740 _mov(T, Src0, Eax); |
1734 _mov(T_edx, Ctx->getConstantZero(Ty), Edx); | 1741 _mov(T_edx, Ctx->getConstantZero(Ty)); |
1735 _div(T, Src1, T_edx); | 1742 _div(T, Src1, T_edx); |
1736 _mov(Dest, T); | 1743 _mov(Dest, T); |
1737 } break; | 1744 } break; |
1738 case InstArithmetic::Sdiv: | 1745 case InstArithmetic::Sdiv: |
1739 // TODO(stichnot): Enable this after doing better performance and cross | 1746 // TODO(stichnot): Enable this after doing better performance and cross |
1740 // testing. | 1747 // testing. |
1741 if (false && Ctx->getFlags().getOptLevel() >= Opt_1) { | 1748 if (false && Ctx->getFlags().getOptLevel() >= Opt_1) { |
1742 // Optimize division by constant power of 2, but not for Om1 or O0, just | 1749 // Optimize division by constant power of 2, but not for Om1 or O0, just |
1743 // to keep things simple there. | 1750 // to keep things simple there. |
1744 if (auto *C = llvm::dyn_cast<ConstantInteger32>(Src1)) { | 1751 if (auto *C = llvm::dyn_cast<ConstantInteger32>(Src1)) { |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2302 SpillVar->setLinkedTo(Dest); | 2309 SpillVar->setLinkedTo(Dest); |
2303 Variable *Spill = SpillVar; | 2310 Variable *Spill = SpillVar; |
2304 Spill->setMustNotHaveReg(); | 2311 Spill->setMustNotHaveReg(); |
2305 _mov(T, Src0RM); | 2312 _mov(T, Src0RM); |
2306 _mov(Spill, T); | 2313 _mov(Spill, T); |
2307 _mov(Dest, Spill); | 2314 _mov(Dest, Spill); |
2308 } break; | 2315 } break; |
2309 case IceType_i64: { | 2316 case IceType_i64: { |
2310 assert(Src0->getType() == IceType_f64); | 2317 assert(Src0->getType() == IceType_f64); |
2311 if (Traits::Is64Bit) { | 2318 if (Traits::Is64Bit) { |
2312 // Movd requires its fp argument (in this case, the bitcast source) to | |
2313 // be an xmm register. | |
2314 Variable *Src0R = legalizeToReg(Src0); | 2319 Variable *Src0R = legalizeToReg(Src0); |
2315 Variable *T = makeReg(IceType_i64); | 2320 Variable *T = makeReg(IceType_i64); |
2316 _movd(T, Src0R); | 2321 _movd(T, Src0R); |
2317 _mov(Dest, T); | 2322 _mov(Dest, T); |
2318 } else { | 2323 } else { |
2319 Operand *Src0RM = legalize(Src0, Legal_Reg | Legal_Mem); | 2324 Operand *Src0RM = legalize(Src0, Legal_Reg | Legal_Mem); |
2320 // a.i64 = bitcast b.f64 ==> | 2325 // a.i64 = bitcast b.f64 ==> |
2321 // s.f64 = spill b.f64 | 2326 // s.f64 = spill b.f64 |
2322 // t_lo.i32 = lo(s.f64) | 2327 // t_lo.i32 = lo(s.f64) |
2323 // a_lo.i32 = t_lo.i32 | 2328 // a_lo.i32 = t_lo.i32 |
(...skipping 25 matching lines...) Expand all Loading... |
2349 _mov(DestLo, T_Lo); | 2354 _mov(DestLo, T_Lo); |
2350 _mov(T_Hi, SpillHi); | 2355 _mov(T_Hi, SpillHi); |
2351 _mov(DestHi, T_Hi); | 2356 _mov(DestHi, T_Hi); |
2352 } | 2357 } |
2353 } break; | 2358 } break; |
2354 case IceType_f64: { | 2359 case IceType_f64: { |
2355 assert(Src0->getType() == IceType_i64); | 2360 assert(Src0->getType() == IceType_i64); |
2356 if (Traits::Is64Bit) { | 2361 if (Traits::Is64Bit) { |
2357 Operand *Src0RM = legalize(Src0, Legal_Reg | Legal_Mem); | 2362 Operand *Src0RM = legalize(Src0, Legal_Reg | Legal_Mem); |
2358 Variable *T = makeReg(IceType_f64); | 2363 Variable *T = makeReg(IceType_f64); |
2359 // Movd requires its fp argument (in this case, the bitcast | |
2360 // destination) to be an xmm register. | |
2361 _movd(T, Src0RM); | 2364 _movd(T, Src0RM); |
2362 _mov(Dest, T); | 2365 _mov(Dest, T); |
2363 } else { | 2366 } else { |
2364 Src0 = legalize(Src0); | 2367 Src0 = legalize(Src0); |
2365 if (llvm::isa<typename Traits::X86OperandMem>(Src0)) { | 2368 if (llvm::isa<typename Traits::X86OperandMem>(Src0)) { |
2366 Variable *T = Func->makeVariable(DestTy); | 2369 Variable *T = Func->makeVariable(DestTy); |
2367 _movq(T, Src0); | 2370 _movq(T, Src0); |
2368 _movq(Dest, T); | 2371 _movq(Dest, T); |
2369 break; | 2372 break; |
2370 } | 2373 } |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3544 } | 3547 } |
3545 case Intrinsics::Sqrt: { | 3548 case Intrinsics::Sqrt: { |
3546 Operand *Src = legalize(Instr->getArg(0)); | 3549 Operand *Src = legalize(Instr->getArg(0)); |
3547 Variable *Dest = Instr->getDest(); | 3550 Variable *Dest = Instr->getDest(); |
3548 Variable *T = makeReg(Dest->getType()); | 3551 Variable *T = makeReg(Dest->getType()); |
3549 _sqrtss(T, Src); | 3552 _sqrtss(T, Src); |
3550 _mov(Dest, T); | 3553 _mov(Dest, T); |
3551 return; | 3554 return; |
3552 } | 3555 } |
3553 case Intrinsics::Stacksave: { | 3556 case Intrinsics::Stacksave: { |
3554 Variable *esp = Func->getTarget()->getPhysicalRegister(getStackReg()); | 3557 Variable *esp = |
| 3558 Func->getTarget()->getPhysicalRegister(getStackReg(), Traits::WordType); |
3555 Variable *Dest = Instr->getDest(); | 3559 Variable *Dest = Instr->getDest(); |
3556 _mov(Dest, esp); | 3560 _mov(Dest, esp); |
3557 return; | 3561 return; |
3558 } | 3562 } |
3559 case Intrinsics::Stackrestore: { | 3563 case Intrinsics::Stackrestore: { |
3560 Variable *esp = Func->getTarget()->getPhysicalRegister(getStackReg()); | 3564 Operand *Src = Instr->getArg(0); |
3561 _redefined(_mov(esp, Instr->getArg(0))); | 3565 const Type SrcTy = Src->getType(); |
| 3566 Variable *esp = Func->getTarget()->getPhysicalRegister( |
| 3567 Traits::getGprForType(SrcTy, getStackReg()), SrcTy); |
| 3568 _redefined(_mov(esp, Src)); |
3562 return; | 3569 return; |
3563 } | 3570 } |
3564 case Intrinsics::Trap: | 3571 case Intrinsics::Trap: |
3565 _ud2(); | 3572 _ud2(); |
3566 return; | 3573 return; |
3567 case Intrinsics::UnknownIntrinsic: | 3574 case Intrinsics::UnknownIntrinsic: |
3568 Func->setError("Should not be lowering UnknownIntrinsic"); | 3575 Func->setError("Should not be lowering UnknownIntrinsic"); |
3569 return; | 3576 return; |
3570 } | 3577 } |
3571 return; | 3578 return; |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4254 ValExt = ValExtVar; | 4261 ValExt = ValExtVar; |
4255 } | 4262 } |
4256 InstCall *Call = makeHelperCall(H_call_memset, nullptr, 3); | 4263 InstCall *Call = makeHelperCall(H_call_memset, nullptr, 3); |
4257 Call->addArg(Dest); | 4264 Call->addArg(Dest); |
4258 Call->addArg(ValExt); | 4265 Call->addArg(ValExt); |
4259 Call->addArg(Count); | 4266 Call->addArg(Count); |
4260 lowerCall(Call); | 4267 lowerCall(Call); |
4261 } | 4268 } |
4262 | 4269 |
4263 template <class Machine> | 4270 template <class Machine> |
4264 void TargetX86Base<Machine>::lowerIndirectJump(Variable *Target) { | 4271 void TargetX86Base<Machine>::lowerIndirectJump(Variable *JumpTarget) { |
4265 const bool NeedSandboxing = Ctx->getFlags().getUseSandboxing(); | 4272 const bool NeedSandboxing = Ctx->getFlags().getUseSandboxing(); |
| 4273 if (Traits::Is64Bit) { |
| 4274 Variable *T = makeReg(IceType_i64); |
| 4275 _movzx(T, JumpTarget); |
| 4276 JumpTarget = T; |
| 4277 } |
4266 if (NeedSandboxing) { | 4278 if (NeedSandboxing) { |
4267 _bundle_lock(); | 4279 _bundle_lock(); |
4268 const SizeT BundleSize = | 4280 const SizeT BundleSize = |
4269 1 << Func->getAssembler<>()->getBundleAlignLog2Bytes(); | 4281 1 << Func->getAssembler<>()->getBundleAlignLog2Bytes(); |
4270 _and(Target, Ctx->getConstantInt32(~(BundleSize - 1))); | 4282 _and(JumpTarget, Ctx->getConstantInt32(~(BundleSize - 1))); |
4271 } | 4283 } |
4272 _jmp(Target); | 4284 _jmp(JumpTarget); |
4273 if (NeedSandboxing) | 4285 if (NeedSandboxing) |
4274 _bundle_unlock(); | 4286 _bundle_unlock(); |
4275 } | 4287 } |
4276 | 4288 |
4277 inline bool isAdd(const Inst *Inst) { | 4289 inline bool isAdd(const Inst *Inst) { |
4278 if (auto *Arith = llvm::dyn_cast_or_null<const InstArithmetic>(Inst)) { | 4290 if (auto *Arith = llvm::dyn_cast_or_null<const InstArithmetic>(Inst)) { |
4279 return (Arith->getOp() == InstArithmetic::Add); | 4291 return (Arith->getOp() == InstArithmetic::Add); |
4280 } | 4292 } |
4281 return false; | 4293 return false; |
4282 } | 4294 } |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4664 Opnd = Mem->getBase(); | 4676 Opnd = Mem->getBase(); |
4665 } | 4677 } |
4666 // At this point Opnd could be nullptr, or Variable, or Constant, or perhaps | 4678 // At this point Opnd could be nullptr, or Variable, or Constant, or perhaps |
4667 // something else. We only care if it is Variable. | 4679 // something else. We only care if it is Variable. |
4668 auto *Var = llvm::dyn_cast_or_null<Variable>(Opnd); | 4680 auto *Var = llvm::dyn_cast_or_null<Variable>(Opnd); |
4669 if (Var == nullptr) | 4681 if (Var == nullptr) |
4670 return; | 4682 return; |
4671 // We use lowerStore() to copy out-args onto the stack. This creates a memory | 4683 // We use lowerStore() to copy out-args onto the stack. This creates a memory |
4672 // operand with the stack pointer as the base register. Don't do bounds | 4684 // operand with the stack pointer as the base register. Don't do bounds |
4673 // checks on that. | 4685 // checks on that. |
4674 if (Var->getRegNum() == Traits::RegisterSet::Reg_esp) | 4686 if (Var->getRegNum() == static_cast<int32_t>(getStackReg())) |
4675 return; | 4687 return; |
4676 | 4688 |
4677 auto *Label = Traits::Insts::Label::create(Func, this); | 4689 auto *Label = Traits::Insts::Label::create(Func, this); |
4678 _cmp(Opnd, Ctx->getConstantZero(IceType_i32)); | 4690 _cmp(Opnd, Ctx->getConstantZero(IceType_i32)); |
4679 _br(Traits::Cond::Br_e, Label); | 4691 _br(Traits::Cond::Br_e, Label); |
4680 _cmp(Opnd, Ctx->getConstantInt32(1)); | 4692 _cmp(Opnd, Ctx->getConstantInt32(1)); |
4681 _br(Traits::Cond::Br_e, Label); | 4693 _br(Traits::Cond::Br_e, Label); |
4682 Context.insert(Label); | 4694 Context.insert(Label); |
4683 } | 4695 } |
4684 | 4696 |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5974 return From; | 5986 return From; |
5975 Const = llvm::cast<Constant>(From); | 5987 Const = llvm::cast<Constant>(From); |
5976 } | 5988 } |
5977 // There should be no constants of vector type (other than undef). | 5989 // There should be no constants of vector type (other than undef). |
5978 assert(!isVectorType(Ty)); | 5990 assert(!isVectorType(Ty)); |
5979 | 5991 |
5980 // If the operand is a 64 bit constant integer we need to legalize it to a | 5992 // If the operand is a 64 bit constant integer we need to legalize it to a |
5981 // register in x86-64. | 5993 // register in x86-64. |
5982 if (Traits::Is64Bit) { | 5994 if (Traits::Is64Bit) { |
5983 if (llvm::isa<ConstantInteger64>(Const)) { | 5995 if (llvm::isa<ConstantInteger64>(Const)) { |
5984 Variable *V = copyToReg(Const, RegNum); | 5996 if (RegNum != Variable::NoRegister) { |
5985 return V; | 5997 assert(Traits::getGprForType(IceType_i64, RegNum) == RegNum); |
| 5998 } |
| 5999 return copyToReg(Const, RegNum); |
5986 } | 6000 } |
5987 } | 6001 } |
5988 | 6002 |
5989 // If the operand is an 32 bit constant integer, we should check whether we | 6003 // If the operand is an 32 bit constant integer, we should check whether we |
5990 // need to randomize it or pool it. | 6004 // need to randomize it or pool it. |
5991 if (auto *C = llvm::dyn_cast<ConstantInteger32>(Const)) { | 6005 if (auto *C = llvm::dyn_cast<ConstantInteger32>(Const)) { |
5992 Operand *NewConst = randomizeOrPoolImmediate(C, RegNum); | 6006 Operand *NewConst = randomizeOrPoolImmediate(C, RegNum); |
5993 if (NewConst != Const) { | 6007 if (NewConst != Const) { |
5994 return NewConst; | 6008 return NewConst; |
5995 } | 6009 } |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6419 } | 6433 } |
6420 // the offset is not eligible for blinding or pooling, return the original | 6434 // the offset is not eligible for blinding or pooling, return the original |
6421 // mem operand | 6435 // mem operand |
6422 return MemOperand; | 6436 return MemOperand; |
6423 } | 6437 } |
6424 | 6438 |
6425 } // end of namespace X86Internal | 6439 } // end of namespace X86Internal |
6426 } // end of namespace Ice | 6440 } // end of namespace Ice |
6427 | 6441 |
6428 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H | 6442 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H |
OLD | NEW |