/// to inline direct function calls to small functions.
///
Pass *createFunctionInliningPass();
+Pass *createFunctionInliningPass(int Threshold);
//===----------------------------------------------------------------------===//
/// createPruneEHPass - Return a new pass object which transforms invoke
///
struct Inliner : public CallGraphSCCPass {
explicit Inliner(const void *ID);
+ explicit Inliner(const void *ID, int Threshold);
/// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should
InlineCostAnalyzer CA;
public:
SimpleInliner() : Inliner(&ID) {}
+ SimpleInliner(int Threshold) : Inliner(&ID, Threshold) {}
static char ID; // Pass identification, replacement for typeid
int getInlineCost(CallSite CS) {
return CA.getInlineCost(CS, NeverInline);
Pass *llvm::createFunctionInliningPass() { return new SimpleInliner(); }
+Pass *llvm::createFunctionInliningPass(int Threshold) {
+ return new SimpleInliner(Threshold);
+}
+
// doInitialization - Initializes the vector of functions that have been
// annotated with the noinline attribute.
bool SimpleInliner::doInitialization(CallGraph &CG) {
Inliner::Inliner(const void *ID)
: CallGraphSCCPass((intptr_t)ID), InlineThreshold(InlineLimit) {}
+Inliner::Inliner(const void *ID, int Threshold)
+ : CallGraphSCCPass((intptr_t)ID), InlineThreshold(Threshold) {}
+
/// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should
/// always explicitly call the implementation here.