summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-03 21:05:48 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-03 21:05:48 +0000
commit3dfe54e954c5ef60bb59cefee29e547f99df9bc9 (patch)
tree2d672fee4679aa25c96da1db91725cf7a4ca84bc /llvm/lib
parente38e4cdc468383013f842bd05181f869b89af6e5 (diff)
downloadbcm5719-llvm-3dfe54e954c5ef60bb59cefee29e547f99df9bc9.tar.gz
bcm5719-llvm-3dfe54e954c5ef60bb59cefee29e547f99df9bc9.zip
Teach InstCombineLoadCast about address spaces.
This is another one that doesn't matter much, but uses the right GEP index types in the first place. llvm-svn: 189854
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 4c382a366d6..88e16e97250 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -304,8 +304,8 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI,
if (Constant *CSrc = dyn_cast<Constant>(CastOp))
if (ASrcTy->getNumElements() != 0) {
Type *IdxTy = TD
- ? TD->getIntPtrType(LI.getContext())
- : Type::getInt64Ty(LI.getContext());
+ ? TD->getIntPtrType(SrcTy)
+ : Type::getInt64Ty(SrcTy->getContext());
Value *Idx = Constant::getNullValue(IdxTy);
Value *Idxs[2] = { Idx, Idx };
CastOp = ConstantExpr::getGetElementPtr(CSrc, Idxs);
OpenPOWER on IntegriCloud