]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/X86/X86.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r301441, and update
[FreeBSD/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 PassRegistry;
26 class X86RegisterBankInfo;
27 class X86Subtarget;
28 class X86TargetMachine;
29
30 /// This pass converts a legalized DAG into a X86-specific DAG, ready for
31 /// instruction scheduling.
32 FunctionPass *createX86ISelDag(X86TargetMachine &TM,
33                                CodeGenOpt::Level OptLevel);
34
35 /// This pass initializes a global base register for PIC on x86-32.
36 FunctionPass *createX86GlobalBaseRegPass();
37
38 /// This pass combines multiple accesses to local-dynamic TLS variables so that
39 /// the TLS base address for the module is only fetched once per execution path
40 /// through the function.
41 FunctionPass *createCleanupLocalDynamicTLSPass();
42
43 /// This function returns a pass which converts floating-point register
44 /// references and pseudo instructions into floating-point stack references and
45 /// physical instructions.
46 FunctionPass *createX86FloatingPointStackifierPass();
47
48 /// This pass inserts AVX vzeroupper instructions before each call to avoid
49 /// transition penalty between functions encoded with AVX and SSE.
50 FunctionPass *createX86IssueVZeroUpperPass();
51
52 /// Return a pass that pads short functions with NOOPs.
53 /// This will prevent a stall when returning on the Atom.
54 FunctionPass *createX86PadShortFunctions();
55
56 /// Return a pass that selectively replaces certain instructions (like add,
57 /// sub, inc, dec, some shifts, and some multiplies) by equivalent LEA
58 /// instructions, in order to eliminate execution delays in some processors.
59 FunctionPass *createX86FixupLEAs();
60
61 /// Return a pass that removes redundant LEA instructions and redundant address
62 /// recalculations.
63 FunctionPass *createX86OptimizeLEAs();
64
65 /// Return a pass that transforms setcc + movzx pairs into xor + setcc.
66 FunctionPass *createX86FixupSetCC();
67
68 /// Return a pass that expands WinAlloca pseudo-instructions.
69 FunctionPass *createX86WinAllocaExpander();
70
71 /// Return a pass that optimizes the code-size of x86 call sequences. This is
72 /// done by replacing esp-relative movs with pushes.
73 FunctionPass *createX86CallFrameOptimization();
74
75 /// Return an IR pass that inserts EH registration stack objects and explicit
76 /// EH state updates. This pass must run after EH preparation, which does
77 /// Windows-specific but architecture-neutral preparation.
78 FunctionPass *createX86WinEHStatePass();
79
80 /// Return a Machine IR pass that expands X86-specific pseudo
81 /// instructions into a sequence of actual instructions. This pass
82 /// must run after prologue/epilogue insertion and before lowering
83 /// the MachineInstr to MC.
84 FunctionPass *createX86ExpandPseudoPass();
85
86 /// Return a Machine IR pass that selectively replaces
87 /// certain byte and word instructions by equivalent 32 bit instructions,
88 /// in order to eliminate partial register usage, false dependences on
89 /// the upper portions of registers, and to save code size.
90 FunctionPass *createX86FixupBWInsts();
91
92 void initializeFixupBWInstPassPass(PassRegistry &);
93
94 /// This pass replaces EVEX ecnoded of AVX-512 instructiosn by VEX 
95 /// encoding when possible in order to reduce code size.
96 FunctionPass *createX86EvexToVexInsts();
97
98 InstructionSelector *createX86InstructionSelector(const X86TargetMachine &TM,
99                                                   X86Subtarget &,
100                                                   X86RegisterBankInfo &);
101
102 void initializeEvexToVexInstPassPass(PassRegistry &);
103
104 } // End llvm namespace
105
106 #endif