diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-08-19 22:17:40 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-08-19 22:17:40 +0000 |
commit | d79f7d9ea10395c93edcaa0d11fbb859975ffa85 (patch) | |
tree | 5ccb5199316508d08eee41a1f7d3c6ccc1da7a3b /llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | |
parent | 98f34e3abe0325b412090bed0f225ef20b9ae5d1 (diff) | |
download | llvm-d79f7d9ea10395c93edcaa0d11fbb859975ffa85.zip llvm-d79f7d9ea10395c93edcaa0d11fbb859975ffa85.tar.gz llvm-d79f7d9ea10395c93edcaa0d11fbb859975ffa85.tar.bz2 |
Teach InstCombine visitGetElementPtr about address spaces
llvm-svn: 188721
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp index bad3756..76796b9 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -1385,9 +1385,10 @@ Instruction *InstCombiner::commonPointerCastTransforms(CastInst &CI) { GEP->accumulateConstantOffset(*TD, Offset)) { // Get the base pointer input of the bitcast, and the type it points to. Value *OrigBase = BCI->getOperand(0); - Type *GEPIdxTy = OrigBase->getType()->getPointerElementType(); SmallVector<Value*, 8> NewIndices; - if (FindElementAtOffset(GEPIdxTy, Offset.getSExtValue(), NewIndices)) { + if (FindElementAtOffset(OrigBase->getType(), + Offset.getSExtValue(), + NewIndices)) { // If we were able to index down into an element, create the GEP // and bitcast the result. This eliminates one bitcast, potentially // two. |