1 //===-- Passes.h - Target independent code generation passes ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // This file defines interfaces to access the target independent code generation
11 // passes provided by the LLVM backend.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CODEGEN_PASSES_H
16 #define LLVM_CODEGEN_PASSES_H
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
33 FunctionPass *createUnreachableBlockEliminationPass();
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 ="");
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);
45 extern const PassInfo *PHIEliminationID;
47 /// TwoAddressInstruction pass - This pass reduces two-address instructions to
48 /// use two operands. This destroys SSA information but it is desired by
49 /// register allocators.
50 extern const PassInfo *TwoAddressInstructionPassID;
52 /// Creates a register allocator as the user specified on the command line.
54 FunctionPass *createRegisterAllocator();
56 /// SimpleRegisterAllocation Pass - This pass converts the input machine code
57 /// from SSA form to use explicit registers by spilling every register. Wow,
60 FunctionPass *createSimpleRegisterAllocator();
62 /// LocalRegisterAllocation Pass - This pass register allocates the input code
63 /// a basic block at a time, yielding code better than the simple register
64 /// allocator, but not as good as a global allocator.
66 FunctionPass *createLocalRegisterAllocator();
68 /// LinearScanRegisterAllocation Pass - This pass implements the linear scan
69 /// register allocation algorithm, a global register allocator.
71 FunctionPass *createLinearScanRegisterAllocator();
73 /// IterativeScanRegisterAllocation Pass - This pass implements the iterative
74 /// scan register allocation algorithm, a global register allocator.
76 FunctionPass *createIterativeScanRegisterAllocator();
78 /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
79 /// and eliminates abstract frame references.
81 FunctionPass *createPrologEpilogCodeInserter();
83 /// MachineCodeDeletion Pass - This pass deletes all of the machine code for
84 /// the current function, which should happen after the function has been
85 /// emitted to a .s file or to memory.
86 FunctionPass *createMachineCodeDeleter();
88 /// getRegisterAllocator - This creates an instance of the register allocator
90 FunctionPass *getRegisterAllocator(TargetMachine &T);
92 //createModuloSchedulingPass - Creates the Swing Modulo Scheduling Pass
93 FunctionPass *createModuloSchedulingPass(TargetMachine & targ);
95 } // End llvm namespace