@@ -1683,21 +1683,13 @@ class TargetLoweringBase {
16831683
16841684 if (auto *VTy = dyn_cast<VectorType>(Ty)) {
16851685 Type *EltTy = VTy->getElementType ();
1686- ElementCount EC = VTy->getElementCount ();
16871686 // Lower vectors of pointers to native pointer types.
16881687 if (auto *PTy = dyn_cast<PointerType>(EltTy)) {
16891688 EVT PointerTy (getPointerTy (DL, PTy->getAddressSpace ()));
1690- // Kludge around AMDGPU's fat pointers which, while not lowered to
1691- // codegen, still needed an MVT, and could only use vectors because
1692- // there weren't big enough scalars. Therefore, flatten the nominal
1693- // vector-of-vectors.
1694- if (PointerTy.isVector ()) {
1695- EC = EC * PointerTy.getVectorNumElements ();
1696- PointerTy = PointerTy.getVectorElementType ();
1697- }
16981689 EltTy = PointerTy.getTypeForEVT (Ty->getContext ());
16991690 }
1700- return EVT::getVectorVT (Ty->getContext (), EVT::getEVT (EltTy, false ), EC);
1691+ return EVT::getVectorVT (Ty->getContext (), EVT::getEVT (EltTy, false ),
1692+ VTy->getElementCount ());
17011693 }
17021694
17031695 return EVT::getEVT (Ty, AllowUnknown);
@@ -1711,25 +1703,18 @@ class TargetLoweringBase {
17111703
17121704 if (auto *VTy = dyn_cast<VectorType>(Ty)) {
17131705 Type *EltTy = VTy->getElementType ();
1714- ElementCount EC = VTy->getElementCount ();
17151706 if (auto *PTy = dyn_cast<PointerType>(EltTy)) {
17161707 EVT PointerTy (getPointerMemTy (DL, PTy->getAddressSpace ()));
1717- // Kludge around AMDGPU's fat pointers which, while not lowered to
1718- // codegen, still needed an MVT, and could only use vectors because
1719- // there weren't big enough scalars. Therefore, flatten the nominal
1720- // vector-of-vectors.
1721- if (PointerTy.isVector ()) {
1722- EC = EC * PointerTy.getVectorNumElements ();
1723- PointerTy = PointerTy.getVectorElementType ();
1724- }
17251708 EltTy = PointerTy.getTypeForEVT (Ty->getContext ());
17261709 }
1727- return EVT::getVectorVT (Ty->getContext (), EVT::getEVT (EltTy, false ), EC);
1710+ return EVT::getVectorVT (Ty->getContext (), EVT::getEVT (EltTy, false ),
1711+ VTy->getElementCount ());
17281712 }
17291713
17301714 return getValueType (DL, Ty, AllowUnknown);
17311715 }
17321716
1717+
17331718 // / Return the MVT corresponding to this LLVM type. See getValueType.
17341719 MVT getSimpleValueType (const DataLayout &DL, Type *Ty,
17351720 bool AllowUnknown = false ) const {
0 commit comments