Split AllOpts.h into lots of little .h files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2001-06-30 04:34:07 +00:00
parent 2b05880476
commit 50d0b7ec3f
9 changed files with 214 additions and 111 deletions

View File

@@ -0,0 +1,65 @@
//===-- ConstantProp.h - Functions for Constant Propogation ------*- C++ -*--=//
//
// This family of functions are useful for performing constant propogation.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_OPT_CONSTANT_PROPOGATION_H
#define LLVM_OPT_CONSTANT_PROPOGATION_H
#include "llvm/Module.h"
class Method;
class TerminatorInst;
class ConstantPool;
namespace opt {
// DoConstantPropogation - Do trivial constant propogation and expression
// folding
bool DoConstantPropogation(Method *M);
static inline bool DoConstantPropogation(Module *M) {
return M->reduceApply(DoConstantPropogation);
}
// ConstantFoldTerminator - If a terminator instruction is predicated on a
// constant value, convert it into an unconditional branch to the constant
// destination.
//
bool ConstantFoldTerminator(TerminatorInst *T);
//===----------------------------------------------------------------------===//
// Constant Pool Merging Pass
//
// This function merges all constants in the specified constant pool that have
// identical types and values. This is useful for passes that generate lots of
// constants as a side effect of running.
//
bool DoConstantPoolMerging(ConstantPool &CP);
bool DoConstantPoolMerging(Method *M);
static inline bool DoConstantPoolMerging(Module *M) {
return M->reduceApply(DoConstantPoolMerging) |
DoConstantPoolMerging(M->getConstantPool());
}
//===----------------------------------------------------------------------===//
// Sparse Conditional Constant Propogation Pass
//
bool DoSparseConditionalConstantProp(Method *M);
static inline bool DoSparseConditionalConstantProp(Module *M) {
return M->reduceApply(DoSparseConditionalConstantProp);
}
// Define a shorter version of the name...
template <class Unit> bool DoSCCP(Unit *M) {
return DoSparseConditionalConstantProp(M);
}
} // End Namespace opt
#endif