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 /// 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 ="");
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);
37 extern const PassInfo *PHIEliminationID;
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;
44 /// Creates a register allocator as the user specified on the command line.
46 FunctionPass *createRegisterAllocator();
48 /// SimpleRegisterAllocation Pass - This pass converts the input machine code
49 /// from SSA form to use explicit registers by spilling every register. Wow,
52 FunctionPass *createSimpleRegisterAllocator();
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.
58 FunctionPass *createLocalRegisterAllocator();
60 /// LinearScanRegisterAllocation Pass - This pass implements the linear scan
61 /// register allocation algorithm, a global register allocator.
63 FunctionPass *createLinearScanRegisterAllocator();
65 /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
66 /// and eliminates abstract frame references.
68 FunctionPass *createPrologEpilogCodeInserter();
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();
75 /// getRegisterAllocator - This creates an instance of the register allocator
77 FunctionPass *getRegisterAllocator(TargetMachine &T);
79 //createModuloSchedulingPass - Creates the Swing Modulo Scheduling Pass
80 FunctionPass *createModuloSchedulingPass(TargetMachine & targ);
82 } // End llvm namespace