blob: 65c13bf001f4043f207dc8c74a0ddebcdc68617c [file] [log] [blame]
Chris Lattner72614082002-10-25 22:55:53 +00001//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
John Criswell856ba762003-10-21 15:17:13 +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 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
18#include <iosfwd>
Brian Gaeked0fde302003-11-11 22:41:34 +000019
20namespace llvm {
21
Chris Lattnera535fab2002-10-29 17:43:38 +000022class TargetMachine;
Brian Gaeke9826bdb2003-08-13 18:15:29 +000023class FunctionPass;
Chris Lattner44827152003-12-28 09:47:19 +000024class IntrinsicLowering;
Chris Lattner72614082002-10-25 22:55:53 +000025
Chris Lattnerd281de22003-07-26 23:49:58 +000026/// createX86SimpleInstructionSelector - This pass converts an LLVM function
Chris Lattner83200352003-08-03 15:48:55 +000027/// into a machine code representation in a very simple peep-hole fashion. The
Chris Lattner72614082002-10-25 22:55:53 +000028/// generated code sucks but the implementation is nice and simple.
29///
Chris Lattner44827152003-12-28 09:47:19 +000030FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM,
31 IntrinsicLowering &IL);
Chris Lattner72614082002-10-25 22:55:53 +000032
Chris Lattnerac0c8682003-08-11 14:59:22 +000033/// createX86PatternInstructionSelector - This pass converts an LLVM function
34/// into a machine code representation using pattern matching and a machine
35/// description file.
36///
Chris Lattner44827152003-12-28 09:47:19 +000037FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM,
38 IntrinsicLowering &IL);
Chris Lattnerac0c8682003-08-11 14:59:22 +000039
Chris Lattner9b527702003-12-01 05:18:30 +000040/// createX86SSAPeepholeOptimizerPass - Create a pass to perform SSA-based X86
41/// specific peephole optimizations.
42///
43FunctionPass *createX86SSAPeepholeOptimizerPass();
44
Chris Lattner31ad5dd2003-01-13 00:45:29 +000045/// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole
46/// optimizations.
Chris Lattner72614082002-10-25 22:55:53 +000047///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000048FunctionPass *createX86PeepholeOptimizerPass();
Chris Lattnerf2ab4122002-12-28 20:26:16 +000049
Alkis Evlogimenos359b65f2003-12-13 05:36:22 +000050/// createX86FloatingPointKiller - This function returns a pass which
51/// kills every floating point register at the end of each basic block
52/// because our FloatingPointStackifier cannot handle them.
53///
54FunctionPass *createX86FloatingPointKillerPass();
55
Chris Lattner31ad5dd2003-01-13 00:45:29 +000056/// createX86FloatingPointStackifierPass - This function returns a pass which
57/// converts floating point register references and pseudo instructions into
58/// floating point stack references and physical instructions.
Chris Lattnerf2ab4122002-12-28 20:26:16 +000059///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000060FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000061
Brian Gaekede420ae2003-07-23 20:25:08 +000062/// createX86CodePrinterPass - Returns a pass that prints the X86
63/// assembly code for a MachineFunction to the given output stream,
64/// using the given target machine description. This should work
65/// regardless of whether the function is in SSA form.
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000066///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000067FunctionPass *createX86CodePrinterPass(std::ostream &o,TargetMachine &tm);
Chris Lattner72614082002-10-25 22:55:53 +000068
Brian Gaeke9826bdb2003-08-13 18:15:29 +000069/// createX86EmitCodeToMemory - Returns a pass that converts a register
70/// allocated function into raw machine code in a dynamically
71/// allocated chunk of memory.
Chris Lattner72614082002-10-25 22:55:53 +000072///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000073FunctionPass *createEmitX86CodeToMemory();
Chris Lattner72614082002-10-25 22:55:53 +000074
Chris Lattner83200352003-08-03 15:48:55 +000075// Defines symbolic names for X86 registers. This defines a mapping from
76// register name to register number.
77//
Brian Gaeked0fde302003-11-11 22:41:34 +000078} // End llvm namespace
79
Chris Lattner83200352003-08-03 15:48:55 +000080#include "X86GenRegisterNames.inc"
81
Chris Lattner8d44ba82003-08-03 21:57:05 +000082// Defines symbolic names for the X86 instructions.
83//
84#include "X86GenInstrNames.inc"
Chris Lattner72614082002-10-25 22:55:53 +000085
86#endif