[llvm] r212963 - Use pointer type cast helpers.
Matt Arsenault
Matthew.Arsenault at amd.com
Mon Jul 14 10:24:39 PDT 2014
Author: arsenm
Date: Mon Jul 14 12:24:38 2014
New Revision: 212963
URL: http://llvm.org/viewvc/llvm-project?rev=212963&view=rev
Log:
Use pointer type cast helpers.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=212963&r1=212962&r2=212963&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Mon Jul 14 12:24:38 2014
@@ -473,7 +473,7 @@ static Instruction *InstCombineStoreToCa
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 *InstCombineStoreToCa
// 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
More information about the llvm-commits
mailing list