blob: 3aee4ce6946fae571f9e0eb9c07c4974676abfee [file] [log] [blame]
Misha Brukmanef6a6a62003-08-21 22:14:26 +00001//===-- Passes.h - Target independent code generation passes ----*- C++ -*-===//
John Criswell6fbcc262003-10-20 20:19:47 +00002//
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 Lattnerdb000652003-01-13 01:01:31 +00009//
Misha Brukmanef6a6a62003-08-21 22:14:26 +000010// This file defines interfaces to access the target independent code generation
Chris Lattnerdb000652003-01-13 01:01:31 +000011// passes provided by the LLVM backend.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CODEGEN_PASSES_H
16#define LLVM_CODEGEN_PASSES_H
17
Brian Gaeked0fde302003-11-11 22:41:34 +000018namespace llvm {
19
Brian Gaeke19df3872003-08-13 18:18:15 +000020class FunctionPass;
Chris Lattnerdb000652003-01-13 01:01:31 +000021class PassInfo;
Chris Lattnere5d1a222003-09-30 20:15:40 +000022class TargetMachine;
Chris Lattnerdb000652003-01-13 01:01:31 +000023
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//
29extern const PassInfo *PHIEliminationID;
30
Alkis Evlogimenos4c080862003-12-18 22:40:24 +000031// 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.
34extern const PassInfo *TwoAddressInstructionPassID;
35
Alkis Evlogimenos7237ece2003-10-02 16:57:49 +000036/// Creates a register allocator as the user specified on the command
37/// line.
38FunctionPass *createRegisterAllocator();
Alkis Evlogimenoseed462b2003-10-02 06:13:19 +000039
Chris Lattnerdb000652003-01-13 01:01:31 +000040/// 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 Gaeke19df3872003-08-13 18:18:15 +000044FunctionPass *createSimpleRegisterAllocator();
Chris Lattnerdb000652003-01-13 01:01:31 +000045
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 Gaeke19df3872003-08-13 18:18:15 +000050FunctionPass *createLocalRegisterAllocator();
Chris Lattnerdb000652003-01-13 01:01:31 +000051
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +000052/// LinearScanRegisterAllocation Pass - This pass implements the
53/// linear scan register allocation algorithm, a global register
54/// allocator.
55///
56FunctionPass *createLinearScanRegisterAllocator();
57
Chris Lattnerdb000652003-01-13 01:01:31 +000058/// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
59/// and eliminates abstract frame references.
60///
Brian Gaeke19df3872003-08-13 18:18:15 +000061FunctionPass *createPrologEpilogCodeInserter();
Chris Lattnerdb000652003-01-13 01:01:31 +000062
Chris Lattner08661092003-09-30 20:14:43 +000063/// getRegisterAllocator - This creates an instance of the register allocator
64/// for the Sparc.
65FunctionPass *getRegisterAllocator(TargetMachine &T);
66
Brian Gaeked0fde302003-11-11 22:41:34 +000067} // End llvm namespace
68
Chris Lattnerdb000652003-01-13 01:01:31 +000069#endif