diff options
| author | David Blaikie <dblaikie@gmail.com> | 2015-03-30 21:41:43 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2015-03-30 21:41:43 +0000 |
| commit | d288fb86810bbac1c2890b70e9ecd6f03744dfa7 (patch) | |
| tree | 22054f443f756bd7ca2d32649f00aaea4ebf4245 /llvm/lib/Transforms/InstCombine | |
| parent | 0d68b4c5ed89f1c8a9e4466badf69de159ee20d7 (diff) | |
| download | bcm5719-llvm-d288fb86810bbac1c2890b70e9ecd6f03744dfa7.tar.gz bcm5719-llvm-d288fb86810bbac1c2890b70e9ecd6f03744dfa7.zip | |
[opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee type
This pushes the use of PointerType::getElementType up into several
callers - I'll essentially just have to keep pushing that up the stack
until I can eliminate every call to it...
llvm-svn: 233604
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 6b0f268c9c8..3b6f4dbeb20 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -611,8 +611,10 @@ static bool canReplaceGEPIdxWithZero(InstCombiner &IC, GetElementPtrInst *GEPI, return false; SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); - Type *AllocTy = - GetElementPtrInst::getIndexedType(GEPI->getOperand(0)->getType(), Ops); + Type *AllocTy = GetElementPtrInst::getIndexedType( + cast<PointerType>(GEPI->getOperand(0)->getType()->getScalarType()) + ->getElementType(), + Ops); if (!AllocTy || !AllocTy->isSized()) return false; const DataLayout &DL = IC.getDataLayout(); |

