blob: 309bf66cf81967749629b630cd8abf1a3b985305 [file] [log] [blame]
Misha Brukmanef6a6a62003-08-21 22:14:26 +00001//===-- Passes.h - Target independent code generation passes ----*- C++ -*-===//
Chris Lattnerdb000652003-01-13 01:01:31 +00002//
Misha Brukmanef6a6a62003-08-21 22:14:26 +00003// This file defines interfaces to access the target independent code generation
Chris Lattnerdb000652003-01-13 01:01:31 +00004// passes provided by the LLVM backend.
5//
6//===----------------------------------------------------------------------===//
7
8#ifndef LLVM_CODEGEN_PASSES_H
9#define LLVM_CODEGEN_PASSES_H
10
Brian Gaeke19df3872003-08-13 18:18:15 +000011class FunctionPass;
Chris Lattnerdb000652003-01-13 01:01:31 +000012class PassInfo;
Chris Lattnere5d1a222003-09-30 20:15:40 +000013class TargetMachine;
Chris Lattnerdb000652003-01-13 01:01:31 +000014
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//
20extern const PassInfo *PHIEliminationID;
21
Alkis Evlogimenoseed462b2003-10-02 06:13:19 +000022enum RegAllocName { simple, local };
23
Chris Lattnerdb000652003-01-13 01:01:31 +000024/// 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 Gaeke19df3872003-08-13 18:18:15 +000028FunctionPass *createSimpleRegisterAllocator();
Chris Lattnerdb000652003-01-13 01:01:31 +000029
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 Gaeke19df3872003-08-13 18:18:15 +000034FunctionPass *createLocalRegisterAllocator();
Chris Lattnerdb000652003-01-13 01:01:31 +000035
36/// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
37/// and eliminates abstract frame references.
38///
Brian Gaeke19df3872003-08-13 18:18:15 +000039FunctionPass *createPrologEpilogCodeInserter();
Chris Lattnerdb000652003-01-13 01:01:31 +000040
Chris Lattner08661092003-09-30 20:14:43 +000041
42/// getRegisterAllocator - This creates an instance of the register allocator
43/// for the Sparc.
44FunctionPass *getRegisterAllocator(TargetMachine &T);
45
Chris Lattnerdb000652003-01-13 01:01:31 +000046#endif