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 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) {