@@ -134,7 +134,6 @@ class CallAnalyzer : public InstVisitor<CallAnalyzer, bool> {
134134 void accumulateSROACost (DenseMap<Value *, int >::iterator CostIt,
135135 int InstructionCost);
136136 bool isGEPOffsetConstant (GetElementPtrInst &GEP);
137- bool isGEPFree (GetElementPtrInst &GEP);
138137 bool accumulateGEPOffset (GEPOperator &GEP, APInt &Offset);
139138 bool simplifyCallSite (Function *F, CallSite CS);
140139 ConstantInt *stripAndComputeInBoundsConstantOffsets (Value *&V);
@@ -332,21 +331,6 @@ bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) {
332331 return true ;
333332}
334333
335- // / \brief Use TTI to check whether a GEP is free.
336- // /
337- // / Respects any simplified values known during the analysis of this callsite.
338- bool CallAnalyzer::isGEPFree (GetElementPtrInst &GEP) {
339- SmallVector<Value *, 4 > Indices;
340- for (User::op_iterator I = GEP.idx_begin (), E = GEP.idx_end (); I != E; ++I)
341- if (Constant *SimpleOp = SimplifiedValues.lookup (*I))
342- Indices.push_back (SimpleOp);
343- else
344- Indices.push_back (*I);
345- return TargetTransformInfo::TCC_Free ==
346- TTI.getGEPCost (GEP.getSourceElementType (), GEP.getPointerOperand (),
347- Indices);
348- }
349-
350334bool CallAnalyzer::visitAlloca (AllocaInst &I) {
351335 // Check whether inlining will turn a dynamic alloca into a static
352336 // alloca and handle that case.
@@ -412,7 +396,7 @@ bool CallAnalyzer::visitGetElementPtr(GetElementPtrInst &I) {
412396 // Non-constant GEPs aren't folded, and disable SROA.
413397 if (SROACandidate)
414398 disableSROA (CostIt);
415- return isGEPFree (I) ;
399+ return false ;
416400 }
417401
418402 // Add the result as a new mapping to Base + Offset.
@@ -438,7 +422,7 @@ bool CallAnalyzer::visitGetElementPtr(GetElementPtrInst &I) {
438422 // Variable GEPs will require math and will disable SROA.
439423 if (SROACandidate)
440424 disableSROA (CostIt);
441- return isGEPFree (I) ;
425+ return false ;
442426}
443427
444428bool CallAnalyzer::visitBitCast (BitCastInst &I) {
0 commit comments