aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms/Scalar/ConstantProp.h
blob: f094ec5496f538b5e6df117b28e4868522b256c6 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//===-- 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