Index: lib/Target/AMDGPU/SIISelLowering.cpp =================================================================== --- lib/Target/AMDGPU/SIISelLowering.cpp +++ lib/Target/AMDGPU/SIISelLowering.cpp @@ -571,7 +571,7 @@ const SDLoc &SL, SDValue Chain, unsigned Offset, bool Signed) const { const DataLayout &DL = DAG.getDataLayout(); - Type *Ty = VT.getTypeForEVT(*DAG.getContext()); + Type *Ty = MemVT.getTypeForEVT(*DAG.getContext()); PointerType *PtrTy = PointerType::get(Ty, AMDGPUAS::CONSTANT_ADDRESS); MachinePointerInfo PtrInfo(UndefValue::get(PtrTy));