[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
Tue May 30 13:00:28 PDT 2017


eastig updated this revision to Diff 100752.
eastig added a comment.

Removed dead code.


https://reviews.llvm.org/D33685

Files:
  lib/Analysis/InlineCost.cpp


Index: lib/Analysis/InlineCost.cpp
===================================================================
--- lib/Analysis/InlineCost.cpp
+++ lib/Analysis/InlineCost.cpp
@@ -344,15 +344,7 @@
 ///
 /// Respects any simplified values known during the analysis of this callsite.
 bool CallAnalyzer::isGEPFree(GetElementPtrInst &GEP) {
-  SmallVector<Value *, 4> Indices;
-  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);
-     else
-       Indices.push_back(*I);
-  return TargetTransformInfo::TCC_Free ==
-         TTI.getGEPCost(GEP.getSourceElementType(), GEP.getPointerOperand(),
-                        Indices);
+  return TargetTransformInfo::TCC_Free == TTI.getUserCost(&GEP);
 }
 
 bool CallAnalyzer::visitAlloca(AllocaInst &I) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33685.100752.patch
Type: text/x-patch
Size: 858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170530/f169102b/attachment.bin>


More information about the llvm-commits mailing list