summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/TargetTransformInfo.cpp5
-rw-r--r--llvm/lib/Transforms/Scalar/NaryReassociate.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp2
3 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index fad918dabb5..154021a51b9 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -88,6 +88,11 @@ int TargetTransformInfo::getGEPCost(Type *PointeeType, const Value *Ptr,
return TTIImpl->getGEPCost(PointeeType, Ptr, Operands);
}
+int TargetTransformInfo::getGEPCost(const GEPOperator *GEP,
+ ArrayRef<const Value *> Operands) const {
+ return TTIImpl->getGEPCost(GEP, Operands);
+}
+
int TargetTransformInfo::getExtCost(const Instruction *I,
const Value *Src) const {
return TTIImpl->getExtCost(I, Src);
diff --git a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
index d0bfe360389..3d5a513e3d3 100644
--- a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
@@ -264,7 +264,7 @@ static bool isGEPFoldable(GetElementPtrInst *GEP,
SmallVector<const Value*, 4> Indices;
for (auto I = GEP->idx_begin(); I != GEP->idx_end(); ++I)
Indices.push_back(*I);
- return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(),
+ return TTI->getGEPCost(cast<GEPOperator>(GEP),
Indices) == TargetTransformInfo::TCC_Free;
}
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
index 8b8d6590aa6..3f93eaecc5d 100644
--- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
@@ -239,7 +239,7 @@ static bool isGEPFoldable(GetElementPtrInst *GEP,
SmallVector<const Value*, 4> Indices;
for (auto I = GEP->idx_begin(); I != GEP->idx_end(); ++I)
Indices.push_back(*I);
- return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(),
+ return TTI->getGEPCost(cast<GEPOperator>(GEP),
Indices) == TargetTransformInfo::TCC_Free;
}
OpenPOWER on IntegriCloud