Commit dc141af7 authored by Dominik Montada's avatar Dominik Montada Committed by Matt Arsenault
Browse files

[GlobalISel] (fix) Use pointer type size for offset constant when lowering stores

Commit 9965b12f was supposed to change the offset constant when
lowering load/stores, but only introduced this change for loads. This
patch adds the same fix for stores.
parent ef465d0a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2346,8 +2346,8 @@ LegalizerHelper::lower(MachineInstr &MI, unsigned TypeIdx, LLT Ty) {

    // Generate the PtrAdd and truncating stores.
    LLT PtrTy = MRI.getType(PtrReg);
    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));