| Misha Brukman | ef6a6a6 | 2003-08-21 22:14:26 +0000 | [diff] [blame] | 1 | //===-- Passes.h - Target independent code generation passes ----*- C++ -*-===// |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 2 | // |
| Misha Brukman | ef6a6a6 | 2003-08-21 22:14:26 +0000 | [diff] [blame] | 3 | // This file defines interfaces to access the target independent code generation |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 4 | // passes provided by the LLVM backend. |
| 5 | // |
| 6 | //===----------------------------------------------------------------------===// |
| 7 | |
| 8 | #ifndef LLVM_CODEGEN_PASSES_H |
| 9 | #define LLVM_CODEGEN_PASSES_H |
| 10 | |
| Brian Gaeke | 19df387 | 2003-08-13 18:18:15 +0000 | [diff] [blame] | 11 | class FunctionPass; |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 12 | class PassInfo; |
| Chris Lattner | e5d1a22 | 2003-09-30 20:15:40 +0000 | [diff] [blame] | 13 | class TargetMachine; |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 14 | |
| 15 | // PHIElimination pass - This pass eliminates machine instruction PHI nodes by |
| 16 | // inserting copy instructions. This destroys SSA information, but is the |
| 17 | // desired input for some register allocators. This pass is "required" by these |
| 18 | // register allocator like this: AU.addRequiredID(PHIEliminationID); |
| 19 | // |
| 20 | extern const PassInfo *PHIEliminationID; |
| 21 | |
| Alkis Evlogimenos | eed462b | 2003-10-02 06:13:19 +0000 | [diff] [blame^] | 22 | enum RegAllocName { simple, local }; |
| 23 | |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 24 | /// SimpleRegisterAllocation Pass - This pass converts the input machine code |
| 25 | /// from SSA form to use explicit registers by spilling every register. Wow, |
| 26 | /// great policy huh? |
| 27 | /// |
| Brian Gaeke | 19df387 | 2003-08-13 18:18:15 +0000 | [diff] [blame] | 28 | FunctionPass *createSimpleRegisterAllocator(); |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 29 | |
| 30 | /// LocalRegisterAllocation Pass - This pass register allocates the input code a |
| 31 | /// basic block at a time, yielding code better than the simple register |
| 32 | /// allocator, but not as good as a global allocator. |
| 33 | /// |
| Brian Gaeke | 19df387 | 2003-08-13 18:18:15 +0000 | [diff] [blame] | 34 | FunctionPass *createLocalRegisterAllocator(); |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 35 | |
| 36 | /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code, |
| 37 | /// and eliminates abstract frame references. |
| 38 | /// |
| Brian Gaeke | 19df387 | 2003-08-13 18:18:15 +0000 | [diff] [blame] | 39 | FunctionPass *createPrologEpilogCodeInserter(); |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 40 | |
| Chris Lattner | 0866109 | 2003-09-30 20:14:43 +0000 | [diff] [blame] | 41 | |
| 42 | /// getRegisterAllocator - This creates an instance of the register allocator |
| 43 | /// for the Sparc. |
| 44 | FunctionPass *getRegisterAllocator(TargetMachine &T); |
| 45 | |
| Chris Lattner | db00065 | 2003-01-13 01:01:31 +0000 | [diff] [blame] | 46 | #endif |