Add a new MergeFunctions pass. It finds identical functions and merges them.

This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc)
and so it probably wont be turned on by default. Also, may of those are likely
to go away when PR2973 is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2008-11-02 05:52:50 +00:00
parent 8e39432ea9
commit 579a024661
6 changed files with 429 additions and 3 deletions
+9 -3
View File
@@ -38,7 +38,7 @@ ModulePass *createStripSymbolsPass(bool OnlyDebugInfo = false);
/// to invoke/unwind instructions. This should really be part of the C/C++
/// front-end, but it's so much easier to write transformations in LLVM proper.
///
ModulePass* createLowerSetJmpPass();
ModulePass *createLowerSetJmpPass();
//===----------------------------------------------------------------------===//
/// createConstantMergePass - This function returns a new pass that merges
@@ -186,13 +186,19 @@ ModulePass *createStripDeadPrototypesPass();
/// createPartialSpecializationPass - This pass specializes functions for
/// constant arguments.
///
ModulePass* createPartialSpecializationPass();
ModulePass *createPartialSpecializationPass();
//===----------------------------------------------------------------------===//
/// createAddReadAttrsPass - This pass discovers functions that do not access
/// memory, or only read memory, and gives them the readnone/readonly attribute.
///
Pass* createAddReadAttrsPass();
Pass *createAddReadAttrsPass();
//===----------------------------------------------------------------------===//
/// createMergeFunctionsPass - This pass discovers identical functions and
/// collapses them.
///
ModulePass *createMergeFunctionsPass();
} // End llvm namespace