[PATCH] D33685: [InlineCost] Change CallAnalyzer::isGEPFree to use TTI::getUserCost instead of TTI::getGEPCost
Evgeny Astigeevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 29 06:54:07 PDT 2017
eastig updated this revision to Diff 104635.
eastig added a comment.
As https://reviews.llvm.org/D34057(getUserCost with an additional list of operands) is landed we can
switch to use it.
This is NFC because at the end getGEPCost is called with the same arguments.
https://reviews.llvm.org/D33685
Files:
lib/Analysis/InlineCost.cpp
Index: lib/Analysis/InlineCost.cpp
===================================================================
--- lib/Analysis/InlineCost.cpp
+++ lib/Analysis/InlineCost.cpp
@@ -348,15 +348,14 @@
///
/// Respects any simplified values known during the analysis of this callsite.
bool CallAnalyzer::isGEPFree(GetElementPtrInst &GEP) {
- SmallVector<Value *, 4> Indices;
+ SmallVector<Value *, 4> Operands;
+ Operands.push_back(GEP.getOperand(0));
for (User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); I != E; ++I)
if (Constant *SimpleOp = SimplifiedValues.lookup(*I))
- Indices.push_back(SimpleOp);
+ Operands.push_back(SimpleOp);
else
- Indices.push_back(*I);
- return TargetTransformInfo::TCC_Free ==
- TTI.getGEPCost(GEP.getSourceElementType(), GEP.getPointerOperand(),
- Indices);
+ Operands.push_back(*I);
+ return TargetTransformInfo::TCC_Free == TTI.getUserCost(&GEP, Operands);
}
bool CallAnalyzer::visitAlloca(AllocaInst &I) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33685.104635.patch
Type: text/x-patch
Size: 1018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170629/eab8f62c/attachment.bin>
More information about the llvm-commits
mailing list