diff options
Diffstat (limited to 'llvm/lib/Target/ARM/ARMInstructionSelector.cpp')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMInstructionSelector.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstructionSelector.cpp b/llvm/lib/Target/ARM/ARMInstructionSelector.cpp index 188b5562cac9..1c44893581f9 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)); @@ -733,7 +733,7 @@ bool ARMInstructionSelector::selectGlobal(MachineInstrBuilder &MIB, // Add the offset to the SB register. MIB->setDesc(TII.get(Opcodes.ADDrr)); - MIB->RemoveOperand(1); + MIB->removeOperand(1); MIB.addReg(ARM::R9) // FIXME: don't hardcode R9 .addReg(Offset) .add(predOps(ARMCC::AL)) @@ -748,7 +748,7 @@ bool ARMInstructionSelector::selectGlobal(MachineInstrBuilder &MIB, } else { // Load the global's address from the constant pool. MIB->setDesc(TII.get(Opcodes.ConstPoolLoad)); - MIB->RemoveOperand(1); + MIB->removeOperand(1); addOpsForConstantPoolLoad(MIB, GV, /*IsSBREL*/ false); } } else if (STI.isTargetMachO()) { @@ -997,7 +997,7 @@ bool ARMInstructionSelector::select(MachineInstr &I) { auto CPIndex = ConstPool->getConstantPoolIndex(I.getOperand(1).getFPImm(), Alignment); MIB->setDesc(TII.get(LoadOpcode)); - MIB->RemoveOperand(1); + MIB->removeOperand(1); MIB.addConstantPoolIndex(CPIndex, /*Offset*/ 0, /*TargetFlags*/ 0) .addMemOperand( MF.getMachineMemOperand(MachinePointerInfo::getConstantPool(MF), |
