0c395720e66a5366858d370f7f437934511a3851
[oota-llvm.git] / include / llvm / Transforms / Scalar / InstructionCombining.h
1 //===- llvm/Transforms/Scalar/InstructionCombining.h -------------*- C++ -*--=//
2 //
3 // InstructionCombining - Combine instructions to form fewer, simple
4 //   instructions.  This pass does not modify the CFG, and has a tendancy to
5 //   make instructions dead, so a subsequent DCE pass is useful.
6 //
7 // This pass combines things like:
8 //    %Y = add int 1, %X
9 //    %Z = add int 1, %Y
10 // into:
11 //    %Z = add int 2, %X
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_TRANSFORMS_SCALAR_INSTRUCTIONCOMBINING_H
16 #define LLVM_TRANSFORMS_SCALAR_INSTRUCTIONCOMBINING_H
17
18 #include "llvm/Pass.h"
19 class Instruction;
20
21 struct InstructionCombining : public MethodPass {
22   static bool doit(Method *M);
23   static bool CombineInstruction(Instruction *I);
24
25   virtual bool runOnMethod(Method *M) { return doit(M); }
26 };
27
28 #endif