forked from OSchip/llvm-project
Use pointer type size for offset constant when lowering load/stores
This commit is contained in:
parent
2214bc81d0
commit
9965b12fd1
|
@ -2273,8 +2273,8 @@ LegalizerHelper::lower(MachineInstr &MI, unsigned TypeIdx, LLT Ty) {
|
|||
auto LargeLoad =
|
||||
MIRBuilder.buildLoad(LargeLdReg, PtrReg, *LargeMMO);
|
||||
|
||||
auto OffsetCst =
|
||||
MIRBuilder.buildConstant(LLT::scalar(64), LargeSplitSize / 8);
|
||||
auto OffsetCst = MIRBuilder.buildConstant(
|
||||
LLT::scalar(PtrTy.getSizeInBits()), LargeSplitSize / 8);
|
||||
Register PtrAddReg = MRI.createGenericVirtualRegister(PtrTy);
|
||||
auto SmallPtr =
|
||||
MIRBuilder.buildPtrAdd(PtrAddReg, PtrReg, OffsetCst.getReg(0));
|
||||
|
|
Loading…
Reference in New Issue