2007-07-25 18:00:25 +00:00
|
|
|
//===- BasicInliner.h - Basic function level inliner ------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-07-25 18:00:25 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines a simple function based inliner that does not use
|
|
|
|
// call graph information.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef BASICINLINER_H
|
|
|
|
#define BASICINLINER_H
|
|
|
|
|
2009-10-13 18:30:07 +00:00
|
|
|
#include "llvm/Analysis/InlineCost.h"
|
2007-07-25 18:00:25 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Function;
|
|
|
|
class TargetData;
|
2007-10-17 14:56:40 +00:00
|
|
|
struct BasicInlinerImpl;
|
2007-07-25 18:00:25 +00:00
|
|
|
|
|
|
|
/// BasicInliner - BasicInliner provides function level inlining interface.
|
|
|
|
/// Clients provide list of functions which are inline without using
|
|
|
|
/// module level call graph information. Note that the BasicInliner is
|
|
|
|
/// free to delete a function if it is inlined into all call sites.
|
|
|
|
class BasicInliner {
|
|
|
|
public:
|
|
|
|
|
2008-07-07 18:00:37 +00:00
|
|
|
explicit BasicInliner(TargetData *T = NULL);
|
2007-07-25 18:00:25 +00:00
|
|
|
~BasicInliner();
|
|
|
|
|
|
|
|
/// addFunction - Add function into the list of functions to process.
|
|
|
|
/// All functions must be inserted using this interface before invoking
|
|
|
|
/// inlineFunctions().
|
|
|
|
void addFunction(Function *F);
|
|
|
|
|
|
|
|
/// neverInlineFunction - Sometimes a function is never to be inlined
|
|
|
|
/// because of one or other reason.
|
|
|
|
void neverInlineFunction(Function *F);
|
|
|
|
|
|
|
|
/// inlineFuctions - Walk all call sites in all functions supplied by
|
|
|
|
/// client. Inline as many call sites as possible. Delete completely
|
|
|
|
/// inlined functions.
|
|
|
|
void inlineFunctions();
|
|
|
|
|
|
|
|
private:
|
|
|
|
BasicInlinerImpl *Impl;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|