mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Instrcombine should not change load(cast p) to cast(load p) if the cast
changes the address space of the pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64035 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -11007,8 +11007,14 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI,
|
||||
}
|
||||
}
|
||||
|
||||
const Type *DestPTy = cast<PointerType>(CI->getType())->getElementType();
|
||||
const PointerType *DestTy = cast<PointerType>(CI->getType());
|
||||
const Type *DestPTy = DestTy->getElementType();
|
||||
if (const PointerType *SrcTy = dyn_cast<PointerType>(CastOp->getType())) {
|
||||
|
||||
// If the address spaces don't match, don't eliminate the cast.
|
||||
if (DestTy->getAddressSpace() != SrcTy->getAddressSpace())
|
||||
return 0;
|
||||
|
||||
const Type *SrcPTy = SrcTy->getElementType();
|
||||
|
||||
if (DestPTy->isInteger() || isa<PointerType>(DestPTy) ||
|
||||
|
||||
Reference in New Issue
Block a user