mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
9152a47906
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@437 91177308-0d34-0410-b5e6-96231b3b80d8
44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
//===-- 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;
|
|
|
|
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);
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Sparse Conditional Constant Propogation Pass
|
|
//
|
|
|
|
bool DoSCCP(Method *M);
|
|
static inline bool DoSCCP(Module *M) {
|
|
return M->reduceApply(DoSCCP);
|
|
}
|
|
|
|
} // End Namespace opt
|
|
|
|
#endif
|