diff --git a/llvm/lib/Target/BPF/BPFTargetTransformInfo.h b/llvm/lib/Target/BPF/BPFTargetTransformInfo.h --- a/llvm/lib/Target/BPF/BPFTargetTransformInfo.h +++ b/llvm/lib/Target/BPF/BPFTargetTransformInfo.h @@ -71,6 +71,15 @@ Opd2Info, Opd1PropInfo, Opd2PropInfo); } + + InstructionCost getGEPCost(Type *PointeeType, const Value *Ptr, + ArrayRef Operands, + TTI::TargetCostKind CostKind) { + for (unsigned Idx = 0, Size = Operands.size(); Idx != Size; ++Idx) + if (!isa(Operands[Idx])) + return TTI::TCC_Basic; + return TTI::TCC_Free; + } }; } // end namespace llvm