1 //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the entry points for global functions defined in the x86
11 // target library, as used by the LLVM JIT.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_X86_X86_H
16 #define LLVM_LIB_TARGET_X86_X86_H
18 #include "llvm/Support/CodeGen.h"
24 class X86TargetMachine;
26 /// This pass converts a legalized DAG into a X86-specific DAG, ready for
27 /// instruction scheduling.
28 FunctionPass *createX86ISelDag(X86TargetMachine &TM,
29 CodeGenOpt::Level OptLevel);
31 /// This pass initializes a global base register for PIC on x86-32.
32 FunctionPass *createX86GlobalBaseRegPass();
34 /// This pass combines multiple accesses to local-dynamic TLS variables so that
35 /// the TLS base address for the module is only fetched once per execution path
36 /// through the function.
37 FunctionPass *createCleanupLocalDynamicTLSPass();
39 /// This function returns a pass which converts floating-point register
40 /// references and pseudo instructions into floating-point stack references and
41 /// physical instructions.
42 FunctionPass *createX86FloatingPointStackifierPass();
44 /// This pass inserts AVX vzeroupper instructions before each call to avoid
45 /// transition penalty between functions encoded with AVX and SSE.
46 FunctionPass *createX86IssueVZeroUpperPass();
48 /// Return a pass that pads short functions with NOOPs.
49 /// This will prevent a stall when returning on the Atom.
50 FunctionPass *createX86PadShortFunctions();
52 /// Return a pass that selectively replaces certain instructions (like add,
53 /// sub, inc, dec, some shifts, and some multiplies) by equivalent LEA
54 /// instructions, in order to eliminate execution delays in some processors.
55 FunctionPass *createX86FixupLEAs();
57 /// Return a pass that removes redundant LEA instructions and redundant address
59 FunctionPass *createX86OptimizeLEAs();
61 /// Return a pass that optimizes the code-size of x86 call sequences. This is
62 /// done by replacing esp-relative movs with pushes.
63 FunctionPass *createX86CallFrameOptimization();
65 /// Return an IR pass that inserts EH registration stack objects and explicit
66 /// EH state updates. This pass must run after EH preparation, which does
67 /// Windows-specific but architecture-neutral preparation.
68 FunctionPass *createX86WinEHStatePass();
70 /// Return a Machine IR pass that expands X86-specific pseudo
71 /// instructions into a sequence of actual instructions. This pass
72 /// must run after prologue/epilogue insertion and before lowering
73 /// the MachineInstr to MC.
74 FunctionPass *createX86ExpandPseudoPass();
75 } // End llvm namespace