3f5332368c51625bfef2c5ee48b1bfba3d016d2c
[oota-llvm.git] / lib / Target / X86 / X86.h
1 //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the entry points for global functions defined in the x86
11 // target library, as used by the LLVM JIT.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef TARGET_X86_H
16 #define TARGET_X86_H
17
18 #include <iosfwd>
19
20 namespace llvm {
21
22 class TargetMachine;
23 class PassManager;
24 class FunctionPass;
25 class IntrinsicLowering;
26 class MachineCodeEmitter;
27
28 extern bool X86DAGIsel;
29
30 /// createX86ISelPattern - This pass converts an LLVM function into a 
31 /// machine code representation using pattern matching and a machine
32 /// description file.
33 ///
34 FunctionPass *createX86ISelPattern(TargetMachine &TM);
35
36 /// createX86ISelDag - This pass converts a legalized DAG into a 
37 /// X86-specific DAG, ready for instruction scheduling.
38 ///
39 FunctionPass *createX86ISelDag(TargetMachine &TM);
40
41 /// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole
42 /// optimizations.
43 ///
44 FunctionPass *createX86PeepholeOptimizerPass();
45
46 /// createX86FloatingPointStackifierPass - This function returns a pass which
47 /// converts floating point register references and pseudo instructions into
48 /// floating point stack references and physical instructions.
49 ///
50 FunctionPass *createX86FloatingPointStackifierPass();
51
52 /// createX86CodePrinterPass - Returns a pass that prints the X86
53 /// assembly code for a MachineFunction to the given output stream,
54 /// using the given target machine description.
55 ///
56 FunctionPass *createX86CodePrinterPass(std::ostream &o, TargetMachine &tm);
57
58 /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
59 /// to the specified MCE object.
60 FunctionPass *createX86CodeEmitterPass(MachineCodeEmitter &MCE);
61
62 /// addX86ELFObjectWriterPass - Add passes to the FPM that output the generated
63 /// code as an ELF object file.
64 ///
65 void addX86ELFObjectWriterPass(PassManager &FPM,
66                                std::ostream &o, TargetMachine &tm);
67
68 /// createX86EmitCodeToMemory - Returns a pass that converts a register
69 /// allocated function into raw machine code in a dynamically
70 /// allocated chunk of memory.
71 ///
72 FunctionPass *createEmitX86CodeToMemory();
73
74 } // End llvm namespace
75
76 // Defines symbolic names for X86 registers.  This defines a mapping from
77 // register name to register number.
78 //
79 #include "X86GenRegisterNames.inc"
80
81 // Defines symbolic names for the X86 instructions.
82 //
83 #include "X86GenInstrNames.inc"
84
85 #endif