Generalize MVT::ValueType and associated functions to be able to represent
[oota-llvm.git] / include / llvm / CodeGen / Passes.h
1 //===-- Passes.h - Target independent code generation passes ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines interfaces to access the target independent code generation
11 // passes provided by the LLVM backend.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CODEGEN_PASSES_H
16 #define LLVM_CODEGEN_PASSES_H
17
18 #include <iosfwd>
19 #include <string>
20
21 namespace llvm {
22
23   class FunctionPass;
24   class PassInfo;
25   class TargetMachine;
26
27   /// createUnreachableBlockEliminationPass - The LLVM code generator does not
28   /// work well with unreachable basic blocks (what live ranges make sense for a
29   /// block that cannot be reached?).  As such, a code generator should either
30   /// not instruction select unreachable blocks, or it can run this pass as it's
31   /// last LLVM modifying pass to clean up blocks that are not reachable from
32   /// the entry block.
33   FunctionPass *createUnreachableBlockEliminationPass();
34
35   /// MachineFunctionPrinter pass - This pass prints out the machine function to
36   /// standard error, as a debugging tool.
37   FunctionPass *createMachineFunctionPrinterPass(std::ostream *OS,
38                                                  const std::string &Banner ="");
39
40   /// PHIElimination pass - This pass eliminates machine instruction PHI nodes
41   /// by inserting copy instructions.  This destroys SSA information, but is the
42   /// desired input for some register allocators.  This pass is "required" by
43   /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
44   ///
45   extern const PassInfo *PHIEliminationID;
46
47   /// SimpleRegisterCoalescing pass.  Aggressively coalesces every register
48   /// copy it can.
49   ///
50   extern const PassInfo *SimpleRegisterCoalescingID;
51
52   /// TwoAddressInstruction pass - This pass reduces two-address instructions to
53   /// use two operands. This destroys SSA information but it is desired by
54   /// register allocators.
55   extern const PassInfo *TwoAddressInstructionPassID;
56
57   /// Creates a register allocator as the user specified on the command line.
58   ///
59   FunctionPass *createRegisterAllocator();
60
61   /// SimpleRegisterAllocation Pass - This pass converts the input machine code
62   /// from SSA form to use explicit registers by spilling every register.  Wow,
63   /// great policy huh?
64   ///
65   FunctionPass *createSimpleRegisterAllocator();
66
67   /// LocalRegisterAllocation Pass - This pass register allocates the input code
68   /// a basic block at a time, yielding code better than the simple register
69   /// allocator, but not as good as a global allocator.
70   ///
71   FunctionPass *createLocalRegisterAllocator();
72
73   /// BigBlockRegisterAllocation Pass - The BigBlock register allocator
74   /// munches single basic blocks at a time, like the local register
75   /// allocator.  While the BigBlock allocator is a little slower, and uses
76   /// somewhat more memory than the local register allocator, it tends to
77   /// yield the best allocations (of any of the allocators) for blocks that
78   /// have hundreds or thousands of instructions in sequence.
79   ///
80   FunctionPass *createBigBlockRegisterAllocator();
81
82   /// LinearScanRegisterAllocation Pass - This pass implements the linear scan
83   /// register allocation algorithm, a global register allocator.
84   ///
85   FunctionPass *createLinearScanRegisterAllocator();
86
87   /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
88   /// and eliminates abstract frame references.
89   ///
90   FunctionPass *createPrologEpilogCodeInserter();
91
92   /// BranchFolding Pass - This pass performs machine code CFG based
93   /// optimizations to delete branches to branches, eliminate branches to
94   /// successor blocks (creating fall throughs), and eliminating branches over
95   /// branches.
96   FunctionPass *createBranchFoldingPass(bool DefaultEnableTailMerge);
97
98   /// IfConverter Pass - This pass performs machine code if conversion.
99   FunctionPass *createIfConverterPass();
100
101   /// DebugLabelFoldingPass - This pass prunes out redundant debug labels.  This
102   /// allows a debug emitter to determine if the range of two labels is empty,
103   /// by seeing if the labels map to the same reduced label.
104   FunctionPass *createDebugLabelFoldingPass();
105
106   /// MachineCodeDeletion Pass - This pass deletes all of the machine code for
107   /// the current function, which should happen after the function has been
108   /// emitted to a .s file or to memory.
109   FunctionPass *createMachineCodeDeleter();
110
111   /// getRegisterAllocator - This creates an instance of the register allocator
112   /// for the Sparc.
113   FunctionPass *getRegisterAllocator(TargetMachine &T);
114
115   //createModuloSchedulingPass - Creates the Swing Modulo Scheduling Pass
116   FunctionPass *createModuloSchedulingPass(TargetMachine & targ);
117
118   //createModuloSchedulingPass - Creates the Swing Modulo Scheduling Pass
119   FunctionPass *createModuloSchedulingSBPass(TargetMachine & targ);
120
121 } // End llvm namespace
122
123 #endif