mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 06:25:18 +00:00
Convert optimizations to use the Pass infrastructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@871 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7,19 +7,21 @@
|
||||
#ifndef LLVM_OPT_CONSTANT_PROPOGATION_H
|
||||
#define LLVM_OPT_CONSTANT_PROPOGATION_H
|
||||
|
||||
#include "llvm/Module.h"
|
||||
class Method;
|
||||
#include "llvm/Transforms/Pass.h"
|
||||
class TerminatorInst;
|
||||
|
||||
namespace opt {
|
||||
|
||||
// DoConstantPropogation - Do trivial constant propogation and expression
|
||||
// folding
|
||||
bool DoConstantPropogation(Method *M);
|
||||
struct ConstantPropogation : public StatelessPass<ConstantPropogation> {
|
||||
// doConstantPropogation - Do trivial constant propogation and expression
|
||||
// folding
|
||||
static bool doConstantPropogation(Method *M);
|
||||
|
||||
inline static bool doPerMethodWork(Method *M) {
|
||||
return doConstantPropogation(M);
|
||||
}
|
||||
};
|
||||
|
||||
static inline bool DoConstantPropogation(Module *M) {
|
||||
return M->reduceApply(DoConstantPropogation);
|
||||
}
|
||||
|
||||
|
||||
// ConstantFoldTerminator - If a terminator instruction is predicated on a
|
||||
@@ -33,10 +35,13 @@ bool ConstantFoldTerminator(TerminatorInst *T);
|
||||
// Sparse Conditional Constant Propogation Pass
|
||||
//
|
||||
|
||||
bool DoSCCP(Method *M);
|
||||
static inline bool DoSCCP(Module *M) {
|
||||
return M->reduceApply(DoSCCP);
|
||||
}
|
||||
struct SCCPPass : public StatelessPass<SCCPPass> {
|
||||
static bool doSCCP(Method *M);
|
||||
|
||||
inline static bool doPerMethodWork(Method *M) {
|
||||
return doSCCP(M);
|
||||
}
|
||||
};
|
||||
|
||||
} // End Namespace opt
|
||||
|
||||
|
Reference in New Issue
Block a user