diff options
author | Devang Patel <dpatel@apple.com> | 2007-07-25 18:00:25 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-07-25 18:00:25 +0000 |
commit | 6899b314225dd5fa5ccc2a5692daaa89c1d623d8 (patch) | |
tree | 15cabe7a2eb96e54266eec3cf068869cb523dc9e /include/llvm/Transforms/Utils/BasicInliner.h | |
parent | b4d2cac15b19ff1ec0d233ae742884d1632769c6 (diff) | |
download | external_llvm-6899b314225dd5fa5ccc2a5692daaa89c1d623d8.tar.gz external_llvm-6899b314225dd5fa5ccc2a5692daaa89c1d623d8.tar.bz2 external_llvm-6899b314225dd5fa5ccc2a5692daaa89c1d623d8.zip |
Add BasicInliner interface.
This interface allows clients to inline bunch of functions with module
level call graph information.:wq
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40486 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Utils/BasicInliner.h')
-rw-r--r-- | include/llvm/Transforms/Utils/BasicInliner.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/BasicInliner.h b/include/llvm/Transforms/Utils/BasicInliner.h new file mode 100644 index 0000000000..311047ccdd --- /dev/null +++ b/include/llvm/Transforms/Utils/BasicInliner.h @@ -0,0 +1,55 @@ +//===- BasicInliner.h - Basic function level inliner ------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by Devang Patel and is distributed under +// the University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines a simple function based inliner that does not use +// call graph information. +// +//===----------------------------------------------------------------------===// + +#ifndef BASICINLINER_H +#define BASICINLINER_H + +#include "llvm/Transforms/Utils/InlineCost.h" + +namespace llvm { + + class Function; + class TargetData; + class BasicInlinerImpl; + + /// 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: + + BasicInliner(TargetData *T = NULL); + ~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 |