aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/ARMInstructionSelector.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2022-03-30 17:30:28 -0400
committerMatt Arsenault <Matthew.Arsenault@amd.com>2022-03-31 16:46:23 -0400
commit0fb6856afffb3cf5702dba1fc5787f3c17d0810c (patch)
tree167d480d81de8a2224f2240c7649a5514a82449a /llvm/lib/Target/ARM/ARMInstructionSelector.cpp
parentcc2e2b80a1f36a28fa7c96c38c2674b10868f09f (diff)
downloadllvm-0fb6856afffb3cf5702dba1fc5787f3c17d0810c.zip
llvm-0fb6856afffb3cf5702dba1fc5787f3c17d0810c.tar.gz
llvm-0fb6856afffb3cf5702dba1fc5787f3c17d0810c.tar.bz2
ARM/GlobalISel: Get pointer type from value instead of getPointerSize
Avoid using getPointerSize and pass through the original value type.
Diffstat (limited to 'llvm/lib/Target/ARM/ARMInstructionSelector.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMInstructionSelector.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstructionSelector.cpp b/llvm/lib/Target/ARM/ARMInstructionSelector.cpp
index daf0656..1c44893 100644
--- a/llvm/lib/Target/ARM/ARMInstructionSelector.cpp
+++ b/llvm/lib/Target/ARM/ARMInstructionSelector.cpp
@@ -624,12 +624,12 @@ bool ARMInstructionSelector::selectGlobal(MachineInstrBuilder &MIB,
bool UseMovt = STI.useMovt();
- unsigned Size = TM.getPointerSize(0);
+ LLT PtrTy = MRI.getType(MIB->getOperand(0).getReg());
const Align Alignment(4);
- auto addOpsForConstantPoolLoad = [&MF, Alignment,
- Size](MachineInstrBuilder &MIB,
- const GlobalValue *GV, bool IsSBREL) {
+ auto addOpsForConstantPoolLoad = [&MF, Alignment, PtrTy](
+ MachineInstrBuilder &MIB,
+ const GlobalValue *GV, bool IsSBREL) {
assert((MIB->getOpcode() == ARM::LDRi12 ||
MIB->getOpcode() == ARM::t2LDRpci) &&
"Unsupported instruction");
@@ -644,7 +644,7 @@ bool ARMInstructionSelector::selectGlobal(MachineInstrBuilder &MIB,
MIB.addConstantPoolIndex(CPIndex, /*Offset*/ 0, /*TargetFlags*/ 0)
.addMemOperand(MF.getMachineMemOperand(
MachinePointerInfo::getConstantPool(MF), MachineMemOperand::MOLoad,
- Size, Alignment));
+ PtrTy, Alignment));
if (MIB->getOpcode() == ARM::LDRi12)
MIB.addImm(0);
MIB.add(predOps(ARMCC::AL));