blob: fe0dca61b80db0342d0edb45df6b7afda481f560 [file] [log] [blame]
Chris Lattner72614082002-10-25 22:55:53 +00001//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
Misha Brukman0e0a7a452005-04-21 23:38:14 +00002//
John Criswell856ba762003-10-21 15:17:13 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukman0e0a7a452005-04-21 23:38:14 +00007//
John Criswell856ba762003-10-21 15:17:13 +00008//===----------------------------------------------------------------------===//
Chris Lattner72614082002-10-25 22:55:53 +00009//
10// This file contains the entry points for global functions defined in the x86
11// target library, as used by the LLVM JIT.
12//
Chris Lattner72614082002-10-25 22:55:53 +000013//===----------------------------------------------------------------------===//
14
15#ifndef TARGET_X86_H
16#define TARGET_X86_H
17
Bill Wendling98a366d2009-04-29 23:29:43 +000018#include "llvm/Target/TargetMachine.h"
19
Brian Gaeked0fde302003-11-11 22:41:34 +000020namespace llvm {
21
Evan Chengc4c62572006-03-13 23:20:37 +000022class X86TargetMachine;
Brian Gaeke9826bdb2003-08-13 18:15:29 +000023class FunctionPass;
Chris Lattner81b6ed72005-07-11 05:17:48 +000024class MachineCodeEmitter;
Bruno Cardoso Lopesa3f99f92009-05-30 20:51:52 +000025class JITCodeEmitter;
Owen Andersoncb371882008-08-21 00:14:44 +000026class raw_ostream;
Chris Lattner72614082002-10-25 22:55:53 +000027
Chris Lattnerdbdbf0c2005-11-15 00:40:23 +000028/// createX86ISelDag - This pass converts a legalized DAG into a
29/// X86-specific DAG, ready for instruction scheduling.
30///
Bill Wendling98a366d2009-04-29 23:29:43 +000031FunctionPass *createX86ISelDag(X86TargetMachine &TM, CodeGenOpt::Level OptLevel);
Chris Lattner95cdb362005-01-07 07:48:33 +000032
Chris Lattner31ad5dd2003-01-13 00:45:29 +000033/// createX86FloatingPointStackifierPass - This function returns a pass which
34/// converts floating point register references and pseudo instructions into
35/// floating point stack references and physical instructions.
Chris Lattnerf2ab4122002-12-28 20:26:16 +000036///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000037FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000038
Dan Gohmanbc5cbb82008-11-12 22:55:05 +000039/// createX87FPRegKillInserterPass - This function returns a pass which
40/// inserts FP_REG_KILL instructions where needed.
41///
42FunctionPass *createX87FPRegKillInserterPass();
43
Brian Gaekede420ae2003-07-23 20:25:08 +000044/// createX86CodePrinterPass - Returns a pass that prints the X86
45/// assembly code for a MachineFunction to the given output stream,
Chris Lattner81b6ed72005-07-11 05:17:48 +000046/// using the given target machine description.
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000047///
Bill Wendling57f0db82009-02-24 08:30:20 +000048FunctionPass *createX86CodePrinterPass(raw_ostream &o,
49 X86TargetMachine &tm,
Bill Wendling98a366d2009-04-29 23:29:43 +000050 CodeGenOpt::Level OptLevel,
51 bool Verbose);
Chris Lattner72614082002-10-25 22:55:53 +000052
Chris Lattner81b6ed72005-07-11 05:17:48 +000053/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
54/// to the specified MCE object.
Bruno Cardoso Lopesa3f99f92009-05-30 20:51:52 +000055
56FunctionPass *createX86CodeEmitterPass(
57 X86TargetMachine &TM, MachineCodeEmitter &MCE);
58FunctionPass *createX86JITCodeEmitterPass(
59 X86TargetMachine &TM, JITCodeEmitter &JCE);
Chris Lattner81b6ed72005-07-11 05:17:48 +000060
Brian Gaeke9826bdb2003-08-13 18:15:29 +000061/// createX86EmitCodeToMemory - Returns a pass that converts a register
62/// allocated function into raw machine code in a dynamically
63/// allocated chunk of memory.
Chris Lattner72614082002-10-25 22:55:53 +000064///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000065FunctionPass *createEmitX86CodeToMemory();
Chris Lattner72614082002-10-25 22:55:53 +000066
Anton Korobeynikov856914f2008-04-23 18:23:05 +000067/// createX86MaxStackAlignmentCalculatorPass - This function returns a pass which
68/// calculates maximal stack alignment required for function
69///
70FunctionPass *createX86MaxStackAlignmentCalculatorPass();
71
Chris Lattner95cdb362005-01-07 07:48:33 +000072} // End llvm namespace
73
Chris Lattner83200352003-08-03 15:48:55 +000074// Defines symbolic names for X86 registers. This defines a mapping from
75// register name to register number.
76//
77#include "X86GenRegisterNames.inc"
78
Chris Lattner8d44ba82003-08-03 21:57:05 +000079// Defines symbolic names for the X86 instructions.
80//
81#include "X86GenInstrNames.inc"
Chris Lattner72614082002-10-25 22:55:53 +000082
83#endif