summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-10-21 20:03:58 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-10-21 20:03:58 +0000
commit2d7d477d9469695a13c61d0e8b33776aed77f065 (patch)
tree78a94600f27e241016f0f1928ce719b1d70b8b1a /include
parentff71812dfaf30015a9abc5cb4712e67b96fe075e (diff)
downloadllvm-2d7d477d9469695a13c61d0e8b33776aed77f065.tar.gz
llvm-2d7d477d9469695a13c61d0e8b33776aed77f065.tar.bz2
llvm-2d7d477d9469695a13c61d0e8b33776aed77f065.tar.xz
Fix CodeGen for vectors of pointers with address spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 8aa0abdb5e..51d9e00996 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -570,14 +570,18 @@ public:
/// otherwise it will assert.
EVT getValueType(Type *Ty, bool AllowUnknown = false) const {
// Lower scalar pointers to native pointer types.
- if (Ty->isPointerTy()) return getPointerTy(Ty->getPointerAddressSpace());
+ if (PointerType *PTy = dyn_cast<PointerType>(Ty))
+ return getPointerTy(PTy->getAddressSpace());
if (Ty->isVectorTy()) {
VectorType *VTy = cast<VectorType>(Ty);
Type *Elm = VTy->getElementType();
// Lower vectors of pointers to native pointer types.
- if (Elm->isPointerTy())
- Elm = EVT(PointerTy).getTypeForEVT(Ty->getContext());
+ if (PointerType *PT = dyn_cast<PointerType>(Elm)) {
+ EVT PointerTy(getPointerTy(PT->getAddressSpace()));
+ Elm = PointerTy.getTypeForEVT(Ty->getContext());
+ }
+
return EVT::getVectorVT(Ty->getContext(), EVT::getEVT(Elm, false),
VTy->getNumElements());
}