blob: 48b267c61ac09d78b8ece050904a21558471c845 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
//===-- 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
|