| Misha Brukman | ef6a6a6 | 2003-08-21 22:14:26 +0000 | [diff] [blame] | 1 | //===-- Passes.h - Target independent code generation passes ----*- C++ -*-===// |
| John Criswell | 6fbcc26 | 2003-10-20 20:19:47 +0000 | [diff] [blame] | 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 | //===----------------------------------------------------------------------===// |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 9 | // |
| Misha Brukman | ef6a6a6 | 2003-08-21 22:14:26 +0000 | [diff] [blame] | 10 | // This file defines interfaces to access the target independent code generation |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 11 | // passes provided by the LLVM backend. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef LLVM_CODEGEN_PASSES_H |
| 16 | #define LLVM_CODEGEN_PASSES_H |
| 17 | |
| Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 18 | namespace llvm { |
| 19 | |
| Brian Gaeke | 19df387 | 2003-08-13 18:18:15 +0000 | [diff] [blame] | 20 | class FunctionPass; |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 21 | class PassInfo; |
| Chris Lattner | e5d1a22 | 2003-09-30 20:15:40 +0000 | [diff] [blame] | 22 | class TargetMachine; |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 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 | |
| Alkis Evlogimenos | 4c08086 | 2003-12-18 22:40:24 +0000 | [diff] [blame^] | 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 | |
| Alkis Evlogimenos | 7237ece | 2003-10-02 16:57:49 +0000 | [diff] [blame] | 36 | /// Creates a register allocator as the user specified on the command |
| 37 | /// line. |
| 38 | FunctionPass *createRegisterAllocator(); |
| Alkis Evlogimenos | eed462b | 2003-10-02 06:13:19 +0000 | [diff] [blame] | 39 | |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 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 | /// |
| Brian Gaeke | 19df387 | 2003-08-13 18:18:15 +0000 | [diff] [blame] | 44 | FunctionPass *createSimpleRegisterAllocator(); |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 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 | /// |
| Brian Gaeke | 19df387 | 2003-08-13 18:18:15 +0000 | [diff] [blame] | 50 | FunctionPass *createLocalRegisterAllocator(); |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 51 | |
| Alkis Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 52 | /// LinearScanRegisterAllocation Pass - This pass implements the |
| 53 | /// linear scan register allocation algorithm, a global register |
| 54 | /// allocator. |
| 55 | /// |
| 56 | FunctionPass *createLinearScanRegisterAllocator(); |
| 57 | |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 58 | /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code, |
| 59 | /// and eliminates abstract frame references. |
| 60 | /// |
| Brian Gaeke | 19df387 | 2003-08-13 18:18:15 +0000 | [diff] [blame] | 61 | FunctionPass *createPrologEpilogCodeInserter(); |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 62 | |
| Chris Lattner | 0866109 | 2003-09-30 20:14:43 +0000 | [diff] [blame] | 63 | /// getRegisterAllocator - This creates an instance of the register allocator |
| 64 | /// for the Sparc. |
| 65 | FunctionPass *getRegisterAllocator(TargetMachine &T); |
| 66 | |
| Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 67 | } // End llvm namespace |
| 68 | |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 69 | #endif |