Revert r332501 for now, as it can cause build failures on i386.
[freebsd.git] / contrib / llvm / lib / Target / X86 / X86.h
1 //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // 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 LLVM_LIB_TARGET_X86_X86_H
16 #define LLVM_LIB_TARGET_X86_X86_H
17
18 #include "llvm/Support/CodeGen.h"
19
20 namespace llvm {
21
22 class FunctionPass;
23 class ImmutablePass;
24 class InstructionSelector;
25 class ModulePass;
26 class PassRegistry;
27 class X86RegisterBankInfo;
28 class X86Subtarget;
29 class X86TargetMachine;
30
31 /// This pass converts a legalized DAG into a X86-specific DAG, ready for
32 /// instruction scheduling.
33 FunctionPass *createX86ISelDag(X86TargetMachine &TM,
34                                CodeGenOpt::Level OptLevel);
35
36 /// This pass initializes a global base register for PIC on x86-32.
37 FunctionPass *createX86GlobalBaseRegPass();
38
39 /// This pass combines multiple accesses to local-dynamic TLS variables so that
40 /// the TLS base address for the module is only fetched once per execution path
41 /// through the function.
42 FunctionPass *createCleanupLocalDynamicTLSPass();
43
44 /// This function returns a pass which converts floating-point register
45 /// references and pseudo instructions into floating-point stack references and
46 /// physical instructions.
47 FunctionPass *createX86FloatingPointStackifierPass();
48
49 /// This pass inserts AVX vzeroupper instructions before each call to avoid
50 /// transition penalty between functions encoded with AVX and SSE.
51 FunctionPass *createX86IssueVZeroUpperPass();
52
53 /// Return a pass that pads short functions with NOOPs.
54 /// This will prevent a stall when returning on the Atom.
55 FunctionPass *createX86PadShortFunctions();
56
57 /// Return a pass that selectively replaces certain instructions (like add,
58 /// sub, inc, dec, some shifts, and some multiplies) by equivalent LEA
59 /// instructions, in order to eliminate execution delays in some processors.
60 FunctionPass *createX86FixupLEAs();
61
62 /// Return a pass that removes redundant LEA instructions and redundant address
63 /// recalculations.
64 FunctionPass *createX86OptimizeLEAs();
65
66 /// Return a pass that transforms setcc + movzx pairs into xor + setcc.
67 FunctionPass *createX86FixupSetCC();
68
69 /// Return a pass that expands WinAlloca pseudo-instructions.
70 FunctionPass *createX86WinAllocaExpander();
71
72 /// Return a pass that optimizes the code-size of x86 call sequences. This is
73 /// done by replacing esp-relative movs with pushes.
74 FunctionPass *createX86CallFrameOptimization();
75
76 /// Return an IR pass that inserts EH registration stack objects and explicit
77 /// EH state updates. This pass must run after EH preparation, which does
78 /// Windows-specific but architecture-neutral preparation.
79 FunctionPass *createX86WinEHStatePass();
80
81 /// Return a Machine IR pass that expands X86-specific pseudo
82 /// instructions into a sequence of actual instructions. This pass
83 /// must run after prologue/epilogue insertion and before lowering
84 /// the MachineInstr to MC.
85 FunctionPass *createX86ExpandPseudoPass();
86
87 /// This pass converts X86 cmov instructions into branch when profitable.
88 FunctionPass *createX86CmovConverterPass();
89
90 /// Return a Machine IR pass that selectively replaces
91 /// certain byte and word instructions by equivalent 32 bit instructions,
92 /// in order to eliminate partial register usage, false dependences on
93 /// the upper portions of registers, and to save code size.
94 FunctionPass *createX86FixupBWInsts();
95
96 /// Return a Machine IR pass that reassigns instruction chains from one domain
97 /// to another, when profitable.
98 FunctionPass *createX86DomainReassignmentPass();
99
100 void initializeFixupBWInstPassPass(PassRegistry &);
101
102 /// This pass replaces EVEX encoded of AVX-512 instructiosn by VEX
103 /// encoding when possible in order to reduce code size.
104 FunctionPass *createX86EvexToVexInsts();
105
106 /// This pass creates the thunks for the retpoline feature.
107 FunctionPass *createX86RetpolineThunksPass();
108
109 InstructionSelector *createX86InstructionSelector(const X86TargetMachine &TM,
110                                                   X86Subtarget &,
111                                                   X86RegisterBankInfo &);
112
113 void initializeEvexToVexInstPassPass(PassRegistry &);
114
115 } // End llvm namespace
116
117 #endif