summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorHaicheng Wu <haicheng@codeaurora.org>2017-01-20 03:40:41 +0000
committerHaicheng Wu <haicheng@codeaurora.org>2017-01-20 03:40:41 +0000
commit8f2aca388b708325b488be548ebc0976f9358edc (patch)
tree40804780c2ac3201b126f83828bfb13060bf5010 /llvm/lib
parentccca669ccd081071d5add8263c681125d76807b0 (diff)
downloadbcm5719-llvm-8f2aca388b708325b488be548ebc0976f9358edc.tar.gz
bcm5719-llvm-8f2aca388b708325b488be548ebc0976f9358edc.zip
Revert "Recommit "[InlineCost] Use TTI to check if GEP is free.""
This reverts commit r292570. The test still has problem. llvm-svn: 292572
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index b6c3997dae3..4109049ecab 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -134,7 +134,6 @@ class CallAnalyzer : public InstVisitor<CallAnalyzer, bool> {
void accumulateSROACost(DenseMap<Value *, int>::iterator CostIt,
int InstructionCost);
bool isGEPOffsetConstant(GetElementPtrInst &GEP);
- bool isGEPFree(GetElementPtrInst &GEP);
bool accumulateGEPOffset(GEPOperator &GEP, APInt &Offset);
bool simplifyCallSite(Function *F, CallSite CS);
ConstantInt *stripAndComputeInBoundsConstantOffsets(Value *&V);
@@ -332,21 +331,6 @@ bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) {
return true;
}
-/// \brief Use TTI to check whether a GEP is free.
-///
-/// 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);
-}
-
bool CallAnalyzer::visitAlloca(AllocaInst &I) {
// Check whether inlining will turn a dynamic alloca into a static
// alloca and handle that case.
@@ -412,7 +396,7 @@ bool CallAnalyzer::visitGetElementPtr(GetElementPtrInst &I) {
// Non-constant GEPs aren't folded, and disable SROA.
if (SROACandidate)
disableSROA(CostIt);
- return isGEPFree(I);
+ return false;
}
// Add the result as a new mapping to Base + Offset.
@@ -438,7 +422,7 @@ bool CallAnalyzer::visitGetElementPtr(GetElementPtrInst &I) {
// Variable GEPs will require math and will disable SROA.
if (SROACandidate)
disableSROA(CostIt);
- return isGEPFree(I);
+ return false;
}
bool CallAnalyzer::visitBitCast(BitCastInst &I) {
OpenPOWER on IntegriCloud