Include <iosfwd> and <string> instead of <iostream>.
[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   /// MachineFunctionPrinter pass - This pass prints out the machine function to
28   /// standard error, as a debugging tool.
29   FunctionPass *createMachineFunctionPrinterPass(std::ostream *OS,
30                                                  const std::string &Banner ="");
31
32   /// PHIElimination pass - This pass eliminates machine instruction PHI nodes
33   /// by inserting copy instructions.  This destroys SSA information, but is the
34   /// desired input for some register allocators.  This pass is "required" by
35   /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
36   ///
37   extern const PassInfo *PHIEliminationID;
38
39   /// TwoAddressInstruction pass - This pass reduces two-address instructions to
40   /// use two operands. This destroys SSA information but it is desired by
41   /// register allocators.
42   extern const PassInfo *TwoAddressInstructionPassID;
43
44   /// Creates a register allocator as the user specified on the command line.
45   ///
46   FunctionPass *createRegisterAllocator();
47
48   /// SimpleRegisterAllocation Pass - This pass converts the input machine code
49   /// from SSA form to use explicit registers by spilling every register.  Wow,
50   /// great policy huh?
51   ///
52   FunctionPass *createSimpleRegisterAllocator();
53
54   /// LocalRegisterAllocation Pass - This pass register allocates the input code
55   /// a basic block at a time, yielding code better than the simple register
56   /// allocator, but not as good as a global allocator.
57   /// 
58   FunctionPass *createLocalRegisterAllocator();
59   
60   /// LinearScanRegisterAllocation Pass - This pass implements the linear scan
61   /// register allocation algorithm, a global register allocator.
62   ///
63   FunctionPass *createLinearScanRegisterAllocator();
64
65   /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
66   /// and eliminates abstract frame references.
67   ///
68   FunctionPass *createPrologEpilogCodeInserter();
69
70   /// MachineCodeDeletion Pass - This pass deletes all of the machine code for
71   /// the current function, which should happen after the function has been
72   /// emitted to a .s file or to memory.
73   FunctionPass *createMachineCodeDeleter();
74     
75   /// getRegisterAllocator - This creates an instance of the register allocator
76   /// for the Sparc.
77   FunctionPass *getRegisterAllocator(TargetMachine &T);
78 } // End llvm namespace
79
80 #endif