mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Teach CodeGenPrepare about address spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190112 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1035,7 +1035,7 @@ bool AddressingModeMatcher::MatchOperationAddr(User *AddrInst, unsigned Opcode,
|
||||
case Instruction::IntToPtr:
|
||||
// This inttoptr is a no-op if the integer type is pointer sized.
|
||||
if (TLI.getValueType(AddrInst->getOperand(0)->getType()) ==
|
||||
TLI.getPointerTy())
|
||||
TLI.getPointerTy(AddrInst->getType()->getPointerAddressSpace()))
|
||||
return MatchAddr(AddrInst->getOperand(0), Depth);
|
||||
return false;
|
||||
case Instruction::BitCast:
|
||||
@@ -1573,9 +1573,7 @@ bool CodeGenPrepare::OptimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
|
||||
} else {
|
||||
DEBUG(dbgs() << "CGP: SINKING nonlocal addrmode: " << AddrMode << " for "
|
||||
<< *MemoryInst);
|
||||
Type *IntPtrTy =
|
||||
TLI->getDataLayout()->getIntPtrType(AccessTy->getContext());
|
||||
|
||||
Type *IntPtrTy = TLI->getDataLayout()->getIntPtrType(Addr->getType());
|
||||
Value *Result = 0;
|
||||
|
||||
// Start with the base register. Do this first so that subsequent address
|
||||
|
Reference in New Issue
Block a user