1193323Sed//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
2193323Sed//
3193323Sed//                     The LLVM Compiler Infrastructure
4193323Sed//
5193323Sed// This file is distributed under the University of Illinois Open Source
6193323Sed// License. See LICENSE.TXT for details.
7193323Sed//
8193323Sed//===----------------------------------------------------------------------===//
9193323Sed//
10193323Sed// This file contains the entry points for global functions defined in the x86
11193323Sed// target library, as used by the LLVM JIT.
12193323Sed//
13193323Sed//===----------------------------------------------------------------------===//
14193323Sed
15193323Sed#ifndef TARGET_X86_H
16193323Sed#define TARGET_X86_H
17193323Sed
18226890Sdim#include "MCTargetDesc/X86BaseInfo.h"
19224145Sdim#include "MCTargetDesc/X86MCTargetDesc.h"
20218893Sdim#include "llvm/Support/DataTypes.h"
21193323Sed#include "llvm/Target/TargetMachine.h"
22193323Sed
23193323Sednamespace llvm {
24193323Sed
25193323Sedclass FunctionPass;
26204642Srdivackyclass JITCodeEmitter;
27204642Srdivackyclass X86TargetMachine;
28193323Sed
29245431Sdim/// createX86ISelDag - This pass converts a legalized DAG into a
30193323Sed/// X86-specific DAG, ready for instruction scheduling.
31193323Sed///
32193323SedFunctionPass *createX86ISelDag(X86TargetMachine &TM,
33193323Sed                               CodeGenOpt::Level OptLevel);
34193323Sed
35210299Sed/// createGlobalBaseRegPass - This pass initializes a global base
36210299Sed/// register for PIC on x86-32.
37210299SedFunctionPass* createGlobalBaseRegPass();
38210299Sed
39245431Sdim/// createCleanupLocalDynamicTLSPass() - This pass combines multiple accesses
40245431Sdim/// to local-dynamic TLS variables so that the TLS base address for the module
41245431Sdim/// is only fetched once per execution path through the function.
42245431SdimFunctionPass *createCleanupLocalDynamicTLSPass();
43245431Sdim
44193323Sed/// createX86FloatingPointStackifierPass - This function returns a pass which
45193323Sed/// converts floating point register references and pseudo instructions into
46193323Sed/// floating point stack references and physical instructions.
47193323Sed///
48193323SedFunctionPass *createX86FloatingPointStackifierPass();
49193323Sed
50226890Sdim/// createX86IssueVZeroUpperPass - This pass inserts AVX vzeroupper instructions
51226890Sdim/// before each call to avoid transition penalty between functions encoded with
52226890Sdim/// AVX and SSE.
53226890SdimFunctionPass *createX86IssueVZeroUpperPass();
54206083Srdivacky
55193323Sed/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
56193323Sed/// to the specified MCE object.
57193323SedFunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
58193323Sed                                          JITCodeEmitter &JCE);
59193323Sed
60193323Sed/// createX86EmitCodeToMemory - Returns a pass that converts a register
61193323Sed/// allocated function into raw machine code in a dynamically
62193323Sed/// allocated chunk of memory.
63193323Sed///
64193323SedFunctionPass *createEmitX86CodeToMemory();
65193323Sed
66252723Sdim/// \brief Creates an X86-specific Target Transformation Info pass.
67252723SdimImmutablePass *createX86TargetTransformInfoPass(const X86TargetMachine *TM);
68207618Srdivacky
69252723Sdim/// createX86PadShortFunctions - Return a pass that pads short functions
70252723Sdim/// with NOOPs. This will prevent a stall when returning on the Atom.
71252723SdimFunctionPass *createX86PadShortFunctions();
72252723Sdim/// createX86FixupLEAs - Return a a pass that selectively replaces
73252723Sdim/// certain instructions (like add, sub, inc, dec, some shifts,
74252723Sdim/// and some multiplies) by equivalent LEA instructions, in order
75252723Sdim/// to eliminate execution delays in some Atom processors.
76252723SdimFunctionPass *createX86FixupLEAs();
77252723Sdim
78193323Sed} // End llvm namespace
79193323Sed
80193323Sed#endif
81