mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 22:07:27 +00:00
Use pointer type cast helpers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212963 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9f40cd7962
commit
547d3e94fa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user