diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-06 00:18:43 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-06 00:18:43 +0000 |
| commit | 37d42ecafff736cc83f3a3eaa0ecd7c56eaa1bc6 (patch) | |
| tree | 409d3bd9346238e6cefffb495b17f2862582353f /llvm/lib/Transforms/Scalar | |
| parent | f216366e6440eb3c03b42538ffa50bccc0c70138 (diff) | |
| download | bcm5719-llvm-37d42ecafff736cc83f3a3eaa0ecd7c56eaa1bc6.tar.gz bcm5719-llvm-37d42ecafff736cc83f3a3eaa0ecd7c56eaa1bc6.zip | |
Teach CodeGenPrepare about address spaces
llvm-svn: 190112
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp index 44804a27aa4..67bf1bbcbf2 100644 --- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -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 |

