X86.h revision 97c7fc351e4dd73041bc7e47c8a144216a50a648
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 20namespace llvm { 21 22class TargetMachine; 23class PassManager; 24class FunctionPass; 25class IntrinsicLowering; 26class MachineCodeEmitter; 27 28enum X86VectorEnum { 29 AutoDetect, NoSSE, SSE, SSE2, SSE3 30}; 31 32extern X86VectorEnum X86Vector; 33extern bool X86ScalarSSE; 34extern bool X86DAGIsel; 35 36/// createX86ISelPattern - This pass converts an LLVM function into a 37/// machine code representation using pattern matching and a machine 38/// description file. 39/// 40FunctionPass *createX86ISelPattern(TargetMachine &TM); 41 42/// createX86ISelDag - This pass converts a legalized DAG into a 43/// X86-specific DAG, ready for instruction scheduling. 44/// 45FunctionPass *createX86ISelDag(TargetMachine &TM); 46 47/// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole 48/// optimizations. 49/// 50FunctionPass *createX86PeepholeOptimizerPass(); 51 52/// createX86FloatingPointStackifierPass - This function returns a pass which 53/// converts floating point register references and pseudo instructions into 54/// floating point stack references and physical instructions. 55/// 56FunctionPass *createX86FloatingPointStackifierPass(); 57 58/// createX86CodePrinterPass - Returns a pass that prints the X86 59/// assembly code for a MachineFunction to the given output stream, 60/// using the given target machine description. 61/// 62FunctionPass *createX86CodePrinterPass(std::ostream &o, TargetMachine &tm); 63 64/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code 65/// to the specified MCE object. 66FunctionPass *createX86CodeEmitterPass(MachineCodeEmitter &MCE); 67 68/// addX86ELFObjectWriterPass - Add passes to the FPM that output the generated 69/// code as an ELF object file. 70/// 71void addX86ELFObjectWriterPass(PassManager &FPM, 72 std::ostream &o, TargetMachine &tm); 73 74/// createX86EmitCodeToMemory - Returns a pass that converts a register 75/// allocated function into raw machine code in a dynamically 76/// allocated chunk of memory. 77/// 78FunctionPass *createEmitX86CodeToMemory(); 79 80} // End llvm namespace 81 82// Defines symbolic names for X86 registers. This defines a mapping from 83// register name to register number. 84// 85#include "X86GenRegisterNames.inc" 86 87// Defines symbolic names for the X86 instructions. 88// 89#include "X86GenInstrNames.inc" 90 91#endif 92