3aee4ce6946fae571f9e0eb9c07c4974676abfee
[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 namespace llvm {
19
20 class FunctionPass;
21 class PassInfo;
22 class TargetMachine;
23
24 // PHIElimination pass - This pass eliminates machine instruction PHI nodes by
25 // inserting copy instructions.  This destroys SSA information, but is the
26 // desired input for some register allocators.  This pass is "required" by these
27 // register allocator like this:  AU.addRequiredID(PHIEliminationID);
28 //
29 extern const PassInfo *PHIEliminationID;
30
31 // TwoAddressInstruction pass - This pass reduces two-address
32 // instructions to use two operands. This destroys SSA information but
33 // it is desired by register allocators.
34 extern const PassInfo *TwoAddressInstructionPassID;
35
36 /// Creates a register allocator as the user specified on the command
37 /// line.
38 FunctionPass *createRegisterAllocator();
39
40 /// SimpleRegisterAllocation Pass - This pass converts the input machine code
41 /// from SSA form to use explicit registers by spilling every register.  Wow,
42 /// great policy huh?
43 ///
44 FunctionPass *createSimpleRegisterAllocator();
45
46 /// LocalRegisterAllocation Pass - This pass register allocates the input code a
47 /// basic block at a time, yielding code better than the simple register
48 /// allocator, but not as good as a global allocator.
49 /// 
50 FunctionPass *createLocalRegisterAllocator();
51
52 /// LinearScanRegisterAllocation Pass - This pass implements the
53 /// linear scan register allocation algorithm, a global register
54 /// allocator.
55 ///
56 FunctionPass *createLinearScanRegisterAllocator();
57
58 /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
59 /// and eliminates abstract frame references.
60 ///
61 FunctionPass *createPrologEpilogCodeInserter();
62
63 /// getRegisterAllocator - This creates an instance of the register allocator
64 /// for the Sparc.
65 FunctionPass *getRegisterAllocator(TargetMachine &T);
66
67 } // End llvm namespace
68
69 #endif