blob: 3b5360ef87cc99e208f26a5e741e933855e426ac [file] [log] [blame]
Chris Lattnerd92fb002002-10-25 22:55:53 +00001//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
John Criswell29265fe2003-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 Lattnerd92fb002002-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 Lattnerd92fb002002-10-25 22:55:53 +000013//===----------------------------------------------------------------------===//
14
15#ifndef TARGET_X86_H
16#define TARGET_X86_H
17
18#include <iosfwd>
Brian Gaeke960707c2003-11-11 22:41:34 +000019
20namespace llvm {
21
Chris Lattner6c3f9c12002-10-29 17:43:38 +000022class TargetMachine;
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000023class FunctionPass;
Chris Lattnerc45a0332003-12-28 09:47:19 +000024class IntrinsicLowering;
Chris Lattnerd92fb002002-10-25 22:55:53 +000025
Chris Lattnera2e2f5c2003-07-26 23:49:58 +000026/// createX86SimpleInstructionSelector - This pass converts an LLVM function
Chris Lattner8b316882003-08-03 15:48:55 +000027/// into a machine code representation in a very simple peep-hole fashion. The
Chris Lattnerd92fb002002-10-25 22:55:53 +000028/// generated code sucks but the implementation is nice and simple.
29///
Chris Lattner5d236002003-12-28 21:23:38 +000030FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM);
Chris Lattnerd92fb002002-10-25 22:55:53 +000031
Chris Lattner6d760d72003-12-01 05:18:30 +000032/// createX86SSAPeepholeOptimizerPass - Create a pass to perform SSA-based X86
33/// specific peephole optimizations.
34///
35FunctionPass *createX86SSAPeepholeOptimizerPass();
36
Chris Lattner61e11952003-01-13 00:45:29 +000037/// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole
38/// optimizations.
Chris Lattnerd92fb002002-10-25 22:55:53 +000039///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000040FunctionPass *createX86PeepholeOptimizerPass();
Chris Lattner49376432002-12-28 20:26:16 +000041
Alkis Evlogimenos904cd6d2003-12-13 05:36:22 +000042/// createX86FloatingPointKiller - This function returns a pass which
43/// kills every floating point register at the end of each basic block
44/// because our FloatingPointStackifier cannot handle them.
45///
46FunctionPass *createX86FloatingPointKillerPass();
47
Chris Lattner61e11952003-01-13 00:45:29 +000048/// createX86FloatingPointStackifierPass - This function returns a pass which
49/// converts floating point register references and pseudo instructions into
50/// floating point stack references and physical instructions.
Chris Lattner49376432002-12-28 20:26:16 +000051///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000052FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattner02a3d832002-10-29 22:37:54 +000053
Brian Gaekea92dce42003-07-23 20:25:08 +000054/// createX86CodePrinterPass - Returns a pass that prints the X86
55/// assembly code for a MachineFunction to the given output stream,
56/// using the given target machine description. This should work
57/// regardless of whether the function is in SSA form.
Chris Lattner02a3d832002-10-29 22:37:54 +000058///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000059FunctionPass *createX86CodePrinterPass(std::ostream &o,TargetMachine &tm);
Chris Lattnerd92fb002002-10-25 22:55:53 +000060
Brian Gaeke1a6f2b82003-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 Lattnerd92fb002002-10-25 22:55:53 +000064///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000065FunctionPass *createEmitX86CodeToMemory();
Chris Lattnerd92fb002002-10-25 22:55:53 +000066
Chris Lattner8b316882003-08-03 15:48:55 +000067// Defines symbolic names for X86 registers. This defines a mapping from
68// register name to register number.
69//
Brian Gaeke960707c2003-11-11 22:41:34 +000070} // End llvm namespace
71
Chris Lattner8b316882003-08-03 15:48:55 +000072#include "X86GenRegisterNames.inc"
73
Chris Lattnerbb8bdc02003-08-03 21:57:05 +000074// Defines symbolic names for the X86 instructions.
75//
76#include "X86GenInstrNames.inc"
Chris Lattnerd92fb002002-10-25 22:55:53 +000077
78#endif