mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-20 10:30:03 +00:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@901 91177308-0d34-0410-b5e6-96231b3b80d8
48 lines
1.2 KiB
C++
48 lines
1.2 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/Pass.h"
|
|
class TerminatorInst;
|
|
|
|
namespace opt {
|
|
|
|
struct ConstantPropogation : public Pass {
|
|
// doConstantPropogation - Do trivial constant propogation and expression
|
|
// folding
|
|
static bool doConstantPropogation(Method *M);
|
|
|
|
inline bool doPerMethodWork(Method *M) {
|
|
return doConstantPropogation(M);
|
|
}
|
|
};
|
|
|
|
|
|
|
|
// 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
|
|
//
|
|
struct SCCPPass : public Pass {
|
|
static bool doSCCP(Method *M);
|
|
|
|
inline bool doPerMethodWork(Method *M) {
|
|
return doSCCP(M);
|
|
}
|
|
};
|
|
|
|
} // End Namespace opt
|
|
|
|
#endif
|