Removed the BigBlock register allocator.
[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 is distributed under the University of Illinois Open Source
6 // 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   class TargetLowering;
27   class RegisterCoalescer;
28
29   /// createUnreachableBlockEliminationPass - The LLVM code generator does not
30   /// work well with unreachable basic blocks (what live ranges make sense for a
31   /// block that cannot be reached?).  As such, a code generator should either
32   /// not instruction select unreachable blocks, or it can run this pass as it's
33   /// last LLVM modifying pass to clean up blocks that are not reachable from
34   /// the entry block.
35   FunctionPass *createUnreachableBlockEliminationPass();
36
37   /// MachineFunctionPrinter pass - This pass prints out the machine function to
38   /// standard error, as a debugging tool.
39   FunctionPass *createMachineFunctionPrinterPass(std::ostream *OS,
40                                                  const std::string &Banner ="");
41
42   /// MachineLoopInfo pass - This pass is a loop analysis pass.
43   /// 
44   extern const PassInfo *const MachineLoopInfoID;
45
46   /// MachineDominators pass - This pass is a machine dominators analysis pass.
47   /// 
48   extern const PassInfo *const MachineDominatorsID;
49
50   /// PHIElimination pass - This pass eliminates machine instruction PHI nodes
51   /// by inserting copy instructions.  This destroys SSA information, but is the
52   /// desired input for some register allocators.  This pass is "required" by
53   /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
54   ///
55   extern const PassInfo *const PHIEliminationID;
56   
57   /// StrongPHIElimination pass - This pass eliminates machine instruction PHI
58   /// nodes by inserting copy instructions.  This destroys SSA information, but
59   /// is the desired input for some register allocators.  This pass is
60   /// "required" by these register allocator like this:
61   ///    AU.addRequiredID(PHIEliminationID);
62   ///  This pass is still in development
63   extern const PassInfo *const StrongPHIEliminationID;
64
65   extern const PassInfo *const PreAllocSplittingID;
66
67   /// SimpleRegisterCoalescing pass.  Aggressively coalesces every register
68   /// copy it can.
69   ///
70   extern const PassInfo *const SimpleRegisterCoalescingID;
71
72   /// TwoAddressInstruction pass - This pass reduces two-address instructions to
73   /// use two operands. This destroys SSA information but it is desired by
74   /// register allocators.
75   extern const PassInfo *const TwoAddressInstructionPassID;
76
77   /// UnreachableMachineBlockElimination pass - This pass removes unreachable
78   /// machine basic blocks.
79   extern const PassInfo *const UnreachableMachineBlockElimID;
80
81   /// DeadMachineInstructionElim pass - This pass removes dead machine
82   /// instructions.
83   ///
84   FunctionPass *createDeadMachineInstructionElimPass();
85
86   /// Creates a register allocator as the user specified on the command line.
87   ///
88   FunctionPass *createRegisterAllocator();
89
90   /// SimpleRegisterAllocation Pass - This pass converts the input machine code
91   /// from SSA form to use explicit registers by spilling every register.  Wow,
92   /// great policy huh?
93   ///
94   FunctionPass *createSimpleRegisterAllocator();
95
96   /// LocalRegisterAllocation Pass - This pass register allocates the input code
97   /// a basic block at a time, yielding code better than the simple register
98   /// allocator, but not as good as a global allocator.
99   ///
100   FunctionPass *createLocalRegisterAllocator();
101
102   /// LinearScanRegisterAllocation Pass - This pass implements the linear scan
103   /// register allocation algorithm, a global register allocator.
104   ///
105   FunctionPass *createLinearScanRegisterAllocator();
106
107   /// PBQPRegisterAllocation Pass - This pass implements the Partitioned Boolean
108   /// Quadratic Prograaming (PBQP) based register allocator.
109   ///
110   FunctionPass *createPBQPRegisterAllocator();
111
112   /// SimpleRegisterCoalescing Pass - Coalesce all copies possible.  Can run
113   /// independently of the register allocator.
114   ///
115   RegisterCoalescer *createSimpleRegisterCoalescer();
116
117   /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
118   /// and eliminates abstract frame references.
119   ///
120   FunctionPass *createPrologEpilogCodeInserter();
121   
122   /// LowerSubregs Pass - This pass lowers subregs to register-register copies
123   /// which yields suboptimal, but correct code if the register allocator
124   /// cannot coalesce all subreg operations during allocation.
125   ///
126   FunctionPass *createLowerSubregsPass();
127
128   /// createPostRAScheduler - under development.
129   FunctionPass *createPostRAScheduler();
130
131   /// BranchFolding Pass - This pass performs machine code CFG based
132   /// optimizations to delete branches to branches, eliminate branches to
133   /// successor blocks (creating fall throughs), and eliminating branches over
134   /// branches.
135   FunctionPass *createBranchFoldingPass(bool DefaultEnableTailMerge);
136
137   /// IfConverter Pass - This pass performs machine code if conversion.
138   FunctionPass *createIfConverterPass();
139
140   /// Code Placement Pass - This pass optimize code placement and aligns loop
141   /// headers to target specific alignment boundary.
142   FunctionPass *createCodePlacementOptPass();
143
144   /// DebugLabelFoldingPass - This pass prunes out redundant debug labels.  This
145   /// allows a debug emitter to determine if the range of two labels is empty,
146   /// by seeing if the labels map to the same reduced label.
147   FunctionPass *createDebugLabelFoldingPass();
148
149   /// MachineCodeDeletion Pass - This pass deletes all of the machine code for
150   /// the current function, which should happen after the function has been
151   /// emitted to a .s file or to memory.
152   FunctionPass *createMachineCodeDeleter();
153
154   /// getRegisterAllocator - This creates an instance of the register allocator
155   /// for the Sparc.
156   FunctionPass *getRegisterAllocator(TargetMachine &T);
157
158   /// IntrinsicLowering Pass - Performs target-independent LLVM IR
159   /// transformations for highly portable strategies.
160   FunctionPass *createGCLoweringPass();
161   
162   /// MachineCodeAnalysis Pass - Target-independent pass to mark safe points in
163   /// machine code. Must be added very late during code generation, just prior
164   /// to output, and importantly after all CFG transformations (such as branch
165   /// folding).
166   FunctionPass *createGCMachineCodeAnalysisPass();
167   
168   /// Deleter Pass - Releases GC metadata.
169   /// 
170   FunctionPass *createGCInfoDeleter();
171   
172   /// Creates a pass to print GC metadata.
173   /// 
174   FunctionPass *createGCInfoPrinter(std::ostream &OS);
175   
176   /// createMachineLICMPass - This pass performs LICM on machine instructions.
177   /// 
178   FunctionPass *createMachineLICMPass();
179
180   /// createMachineSinkingPass - This pass performs sinking on machine
181   /// instructions.
182   FunctionPass *createMachineSinkingPass();
183
184   /// createStackSlotColoringPass - This pass performs stack slot coloring.
185   FunctionPass *createStackSlotColoringPass(bool);
186
187   /// createStackProtectorPass - This pass adds stack protectors to functions.
188   FunctionPass *createStackProtectorPass(const TargetLowering *tli);
189
190   /// createMachineVerifierPass - This pass verifies cenerated machine code
191   /// instructions for correctness.
192   ///
193   /// @param allowPhysDoubleDefs ignore double definitions of
194   ///        registers. Useful before LiveVariables has run.
195   FunctionPass *createMachineVerifierPass(bool allowDoubleDefs);
196
197   /// createDwarfEHPass - This pass mulches exception handling code into a form
198   /// adapted to code generation.  Required if using dwarf exception handling.
199   FunctionPass *createDwarfEHPass(const TargetLowering *tli, bool fast);
200
201 } // End llvm namespace
202
203 #endif