summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/TargetTransformInfo.cpp
diff options
context:
space:
mode:
authorJun Bum Lim <junbuml@codeaurora.org>2017-09-29 14:50:16 +0000
committerJun Bum Lim <junbuml@codeaurora.org>2017-09-29 14:50:16 +0000
commit0e16a59e83f8141bf4d84df5fe0d402688913ee3 (patch)
tree13a5b01aea9374a3244698a4cfc73267a63410a4 /llvm/lib/Analysis/TargetTransformInfo.cpp
parentc9e363ac69f0cb4e9a2198ef9a475c21c695d694 (diff)
downloadbcm5719-llvm-0e16a59e83f8141bf4d84df5fe0d402688913ee3.tar.gz
bcm5719-llvm-0e16a59e83f8141bf4d84df5fe0d402688913ee3.zip
Use the basic cost if a GEP is not used as addressing mode
Summary: Currently, getGEPCost() returns TCC_FREE whenever a GEP is a legal addressing mode in the target. However, since it doesn't check its actual users, it will return FREE even in cases where the GEP cannot be folded away as a part of actual addressing mode. For example, if an user of the GEP is a call instruction taking the GEP as a parameter, then the GEP may not be folded in isel. Reviewers: hfinkel, efriedma, mcrosier, jingyue, haicheng Reviewed By: hfinkel Subscribers: javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D38085 llvm-svn: 314517
Diffstat (limited to 'llvm/lib/Analysis/TargetTransformInfo.cpp')
-rw-r--r--llvm/lib/Analysis/TargetTransformInfo.cpp5
1 files changed, 5 insertions, 0 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);
OpenPOWER on IntegriCloud