diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-07-14 17:24:38 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-07-14 17:24:38 +0000 |
commit | d0d6c0b4c9e9ea2524465104f946c09e862d0388 (patch) | |
tree | 6d2166d2fdb66df181ced27cd2db30f1eaaab14d /llvm/lib | |
parent | 740980ee695205a04b9ac5ff832b66d9ad326ec7 (diff) | |
download | bcm5719-llvm-d0d6c0b4c9e9ea2524465104f946c09e862d0388.tar.gz bcm5719-llvm-d0d6c0b4c9e9ea2524465104f946c09e862d0388.zip |
Use pointer type cast helpers.
llvm-svn: 212963
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index c10e92ad9c2..e9c25d32c28 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -473,7 +473,7 @@ static Instruction *InstCombineStoreToCast(InstCombiner &IC, StoreInst &SI) { User *CI = cast<User>(SI.getOperand(1)); Value *CastOp = CI->getOperand(0); - Type *DestPTy = cast<PointerType>(CI->getType())->getElementType(); + Type *DestPTy = CI->getType()->getPointerElementType(); PointerType *SrcTy = dyn_cast<PointerType>(CastOp->getType()); if (!SrcTy) return nullptr; @@ -518,8 +518,7 @@ static Instruction *InstCombineStoreToCast(InstCombiner &IC, StoreInst &SI) { // If the pointers point into different address spaces don't do the // transformation. - if (SrcTy->getAddressSpace() != - cast<PointerType>(CI->getType())->getAddressSpace()) + if (SrcTy->getAddressSpace() != CI->getType()->getPointerAddressSpace()) return nullptr; // If the pointers point to values of different sizes don't do the |