[llvm] 9965b12 - Use pointer type size for offset constant when lowering load/stores
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 06:55:44 PST 2020
Author: Dominik Montada
Date: 2020-01-27T06:55:32-08:00
New Revision: 9965b12fd1bcb78396fbea2c28d80068e43b31a3
URL: https://github.com/llvm/llvm-project/commit/9965b12fd1bcb78396fbea2c28d80068e43b31a3
DIFF: https://github.com/llvm/llvm-project/commit/9965b12fd1bcb78396fbea2c28d80068e43b31a3.diff
LOG: Use pointer type size for offset constant when lowering load/stores
Added:
Modified:
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index a6fe2c395056..8245fa15f061 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -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));
More information about the llvm-commits
mailing list