xref: /aosp_15_r20/external/llvm/lib/Target/X86/X86.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file contains the entry points for global functions defined in the x86
11*9880d681SAndroid Build Coastguard Worker // target library, as used by the LLVM JIT.
12*9880d681SAndroid Build Coastguard Worker //
13*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
14*9880d681SAndroid Build Coastguard Worker 
15*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_X86_X86_H
16*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_X86_X86_H
17*9880d681SAndroid Build Coastguard Worker 
18*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/CodeGen.h"
19*9880d681SAndroid Build Coastguard Worker 
20*9880d681SAndroid Build Coastguard Worker namespace llvm {
21*9880d681SAndroid Build Coastguard Worker 
22*9880d681SAndroid Build Coastguard Worker class FunctionPass;
23*9880d681SAndroid Build Coastguard Worker class ImmutablePass;
24*9880d681SAndroid Build Coastguard Worker class PassRegistry;
25*9880d681SAndroid Build Coastguard Worker class X86TargetMachine;
26*9880d681SAndroid Build Coastguard Worker 
27*9880d681SAndroid Build Coastguard Worker /// This pass converts a legalized DAG into a X86-specific DAG, ready for
28*9880d681SAndroid Build Coastguard Worker /// instruction scheduling.
29*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86ISelDag(X86TargetMachine &TM,
30*9880d681SAndroid Build Coastguard Worker                                CodeGenOpt::Level OptLevel);
31*9880d681SAndroid Build Coastguard Worker 
32*9880d681SAndroid Build Coastguard Worker /// This pass initializes a global base register for PIC on x86-32.
33*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86GlobalBaseRegPass();
34*9880d681SAndroid Build Coastguard Worker 
35*9880d681SAndroid Build Coastguard Worker /// This pass combines multiple accesses to local-dynamic TLS variables so that
36*9880d681SAndroid Build Coastguard Worker /// the TLS base address for the module is only fetched once per execution path
37*9880d681SAndroid Build Coastguard Worker /// through the function.
38*9880d681SAndroid Build Coastguard Worker FunctionPass *createCleanupLocalDynamicTLSPass();
39*9880d681SAndroid Build Coastguard Worker 
40*9880d681SAndroid Build Coastguard Worker /// This function returns a pass which converts floating-point register
41*9880d681SAndroid Build Coastguard Worker /// references and pseudo instructions into floating-point stack references and
42*9880d681SAndroid Build Coastguard Worker /// physical instructions.
43*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86FloatingPointStackifierPass();
44*9880d681SAndroid Build Coastguard Worker 
45*9880d681SAndroid Build Coastguard Worker /// This pass inserts AVX vzeroupper instructions before each call to avoid
46*9880d681SAndroid Build Coastguard Worker /// transition penalty between functions encoded with AVX and SSE.
47*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86IssueVZeroUpperPass();
48*9880d681SAndroid Build Coastguard Worker 
49*9880d681SAndroid Build Coastguard Worker /// Return a pass that pads short functions with NOOPs.
50*9880d681SAndroid Build Coastguard Worker /// This will prevent a stall when returning on the Atom.
51*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86PadShortFunctions();
52*9880d681SAndroid Build Coastguard Worker 
53*9880d681SAndroid Build Coastguard Worker /// Return a pass that selectively replaces certain instructions (like add,
54*9880d681SAndroid Build Coastguard Worker /// sub, inc, dec, some shifts, and some multiplies) by equivalent LEA
55*9880d681SAndroid Build Coastguard Worker /// instructions, in order to eliminate execution delays in some processors.
56*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86FixupLEAs();
57*9880d681SAndroid Build Coastguard Worker 
58*9880d681SAndroid Build Coastguard Worker /// Return a pass that removes redundant LEA instructions and redundant address
59*9880d681SAndroid Build Coastguard Worker /// recalculations.
60*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86OptimizeLEAs();
61*9880d681SAndroid Build Coastguard Worker 
62*9880d681SAndroid Build Coastguard Worker /// Return a pass that transforms setcc + movzx pairs into xor + setcc.
63*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86FixupSetCC();
64*9880d681SAndroid Build Coastguard Worker 
65*9880d681SAndroid Build Coastguard Worker /// Return a pass that expands WinAlloca pseudo-instructions.
66*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86WinAllocaExpander();
67*9880d681SAndroid Build Coastguard Worker 
68*9880d681SAndroid Build Coastguard Worker /// Return a pass that optimizes the code-size of x86 call sequences. This is
69*9880d681SAndroid Build Coastguard Worker /// done by replacing esp-relative movs with pushes.
70*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86CallFrameOptimization();
71*9880d681SAndroid Build Coastguard Worker 
72*9880d681SAndroid Build Coastguard Worker /// Return an IR pass that inserts EH registration stack objects and explicit
73*9880d681SAndroid Build Coastguard Worker /// EH state updates. This pass must run after EH preparation, which does
74*9880d681SAndroid Build Coastguard Worker /// Windows-specific but architecture-neutral preparation.
75*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86WinEHStatePass();
76*9880d681SAndroid Build Coastguard Worker 
77*9880d681SAndroid Build Coastguard Worker /// Return a Machine IR pass that expands X86-specific pseudo
78*9880d681SAndroid Build Coastguard Worker /// instructions into a sequence of actual instructions. This pass
79*9880d681SAndroid Build Coastguard Worker /// must run after prologue/epilogue insertion and before lowering
80*9880d681SAndroid Build Coastguard Worker /// the MachineInstr to MC.
81*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86ExpandPseudoPass();
82*9880d681SAndroid Build Coastguard Worker 
83*9880d681SAndroid Build Coastguard Worker /// Return a Machine IR pass that selectively replaces
84*9880d681SAndroid Build Coastguard Worker /// certain byte and word instructions by equivalent 32 bit instructions,
85*9880d681SAndroid Build Coastguard Worker /// in order to eliminate partial register usage, false dependences on
86*9880d681SAndroid Build Coastguard Worker /// the upper portions of registers, and to save code size.
87*9880d681SAndroid Build Coastguard Worker FunctionPass *createX86FixupBWInsts();
88*9880d681SAndroid Build Coastguard Worker 
89*9880d681SAndroid Build Coastguard Worker void initializeFixupBWInstPassPass(PassRegistry &);
90*9880d681SAndroid Build Coastguard Worker } // End llvm namespace
91*9880d681SAndroid Build Coastguard Worker 
92*9880d681SAndroid Build Coastguard Worker #endif
93