@@ -134,7 +134,6 @@ class CallAnalyzer : public InstVisitor<CallAnalyzer, bool> {
134
134
void accumulateSROACost (DenseMap<Value *, int >::iterator CostIt,
135
135
int InstructionCost);
136
136
bool isGEPOffsetConstant (GetElementPtrInst &GEP);
137
- bool isGEPFree (GetElementPtrInst &GEP);
138
137
bool accumulateGEPOffset (GEPOperator &GEP, APInt &Offset);
139
138
bool simplifyCallSite (Function *F, CallSite CS);
140
139
ConstantInt *stripAndComputeInBoundsConstantOffsets (Value *&V);
@@ -332,21 +331,6 @@ bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) {
332
331
return true ;
333
332
}
334
333
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
-
350
334
bool CallAnalyzer::visitAlloca (AllocaInst &I) {
351
335
// Check whether inlining will turn a dynamic alloca into a static
352
336
// alloca and handle that case.
@@ -412,7 +396,7 @@ bool CallAnalyzer::visitGetElementPtr(GetElementPtrInst &I) {
412
396
// Non-constant GEPs aren't folded, and disable SROA.
413
397
if (SROACandidate)
414
398
disableSROA (CostIt);
415
- return isGEPFree (I) ;
399
+ return false ;
416
400
}
417
401
418
402
// Add the result as a new mapping to Base + Offset.
@@ -438,7 +422,7 @@ bool CallAnalyzer::visitGetElementPtr(GetElementPtrInst &I) {
438
422
// Variable GEPs will require math and will disable SROA.
439
423
if (SROACandidate)
440
424
disableSROA (CostIt);
441
- return isGEPFree (I) ;
425
+ return false ;
442
426
}
443
427
444
428
bool CallAnalyzer::visitBitCast (BitCastInst &I) {
0 commit comments