mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-17 06:33:21 +00:00
475369e255
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@871 91177308-0d34-0410-b5e6-96231b3b80d8
33 lines
916 B
C++
33 lines
916 B
C++
//===-- InductionVars.h - Induction Variable Recognition ---------*- C++ -*--=//
|
|
//
|
|
// This family of functions is useful for Induction variable recognition,
|
|
// removal and optimizations.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_OPT_INDUCTION_VARS_H
|
|
#define LLVM_OPT_INDUCTION_VARS_H
|
|
|
|
#include "llvm/Transforms/Pass.h"
|
|
#include "llvm/Module.h"
|
|
|
|
namespace opt {
|
|
|
|
// DoInductionVariableCannonicalize - Simplify induction variables in loops
|
|
//
|
|
bool DoInductionVariableCannonicalize(Method *M);
|
|
static inline bool DoInductionVariableCannonicalize(Module *M) {
|
|
return M->reduceApply(DoInductionVariableCannonicalize);
|
|
}
|
|
|
|
struct InductionVariableCannonicalize :
|
|
public StatelessPass<InductionVariableCannonicalize> {
|
|
inline static bool doPerMethodWork(Method *M) {
|
|
return DoInductionVariableCannonicalize(M);
|
|
}
|
|
};
|
|
|
|
} // end namespace opt
|
|
|
|
#endif
|