From: Matt Arsenault Date: Mon, 14 Jul 2014 17:24:38 +0000 (+0000) Subject: Use pointer type cast helpers. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=547d3e94fa643058eafb3b09b07b0f141f4d8aac;p=oota-llvm.git Use pointer type cast helpers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212963 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index c10e92ad9c2..e9c25d32c28 100644 --- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -473,7 +473,7 @@ static Instruction *InstCombineStoreToCast(InstCombiner &IC, StoreInst &SI) { User *CI = cast(SI.getOperand(1)); Value *CastOp = CI->getOperand(0); - Type *DestPTy = cast(CI->getType())->getElementType(); + Type *DestPTy = CI->getType()->getPointerElementType(); PointerType *SrcTy = dyn_cast(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(CI->getType())->getAddressSpace()) + if (SrcTy->getAddressSpace() != CI->getType()->getPointerAddressSpace()) return nullptr; // If the pointers point to values of different sizes don't do the