aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/VectorUtils.cpp
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2016-01-19 17:28:00 +0000
committerEduard Burtescu <edy.burt@gmail.com>2016-01-19 17:28:00 +0000
commit19eb03106d6042a404f4943f3e9efc74da6865f6 (patch)
tree77adf285682b322cf27b5955635970a6a0a332dc /llvm/lib/Analysis/VectorUtils.cpp
parentd9cac592f444c84b63797019975aefbac20e1985 (diff)
downloadllvm-19eb03106d6042a404f4943f3e9efc74da6865f6.zip
llvm-19eb03106d6042a404f4943f3e9efc74da6865f6.tar.gz
llvm-19eb03106d6042a404f4943f3e9efc74da6865f6.tar.bz2
[opaque pointer types] [NFC] GEP: replace get(Pointer)ElementType uses with get{Source,Result}ElementType.
Summary: GEPOperator: provide getResultElementType alongside getSourceElementType. This is made possible by adding a result element type field to GetElementPtrConstantExpr, which GetElementPtrInst already has. GEP: replace get(Pointer)ElementType uses with get{Source,Result}ElementType. Reviewers: mjacob, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16275 llvm-svn: 258145
Diffstat (limited to 'llvm/lib/Analysis/VectorUtils.cpp')
-rw-r--r--llvm/lib/Analysis/VectorUtils.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index ee34769..d9b1354 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -231,8 +231,7 @@ Intrinsic::ID llvm::getIntrinsicIDForCall(CallInst *CI,
unsigned llvm::getGEPInductionOperand(const GetElementPtrInst *Gep) {
const DataLayout &DL = Gep->getModule()->getDataLayout();
unsigned LastOperand = Gep->getNumOperands() - 1;
- unsigned GEPAllocSize = DL.getTypeAllocSize(
- cast<PointerType>(Gep->getType()->getScalarType())->getElementType());
+ unsigned GEPAllocSize = DL.getTypeAllocSize(Gep->getResultElementType());
// Walk backwards and try to peel off zeros.
while (LastOperand > 1 && match(Gep->getOperand(LastOperand), m_Zero())) {