annotate lib/Target/X86/X86.h @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents 1172e4bd9c6f
children 3a76565eade5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 // This file contains the entry points for global functions defined in the x86
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 // target library, as used by the LLVM JIT.
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 //
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 //===----------------------------------------------------------------------===//
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
15 #ifndef LLVM_LIB_TARGET_X86_X86_H
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
16 #define LLVM_LIB_TARGET_X86_X86_H
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
18 #include "llvm/Support/CodeGen.h"
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 namespace llvm {
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 class FunctionPass;
77
54457678186b LLVM 3.6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
23 class ImmutablePass;
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
24 class InstructionSelector;
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
25 class PassRegistry;
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
26 class X86RegisterBankInfo;
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
27 class X86Subtarget;
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 class X86TargetMachine;
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
30 /// This pass converts a legalized DAG into a X86-specific DAG, ready for
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
31 /// instruction scheduling.
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 FunctionPass *createX86ISelDag(X86TargetMachine &TM,
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 CodeGenOpt::Level OptLevel);
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
35 /// This pass initializes a global base register for PIC on x86-32.
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
36 FunctionPass *createX86GlobalBaseRegPass();
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
38 /// This pass combines multiple accesses to local-dynamic TLS variables so that
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
39 /// the TLS base address for the module is only fetched once per execution path
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
40 /// through the function.
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 FunctionPass *createCleanupLocalDynamicTLSPass();
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
43 /// This function returns a pass which converts floating-point register
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
44 /// references and pseudo instructions into floating-point stack references and
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
45 /// physical instructions.
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 FunctionPass *createX86FloatingPointStackifierPass();
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
48 /// This pass inserts AVX vzeroupper instructions before each call to avoid
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
49 /// transition penalty between functions encoded with AVX and SSE.
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 FunctionPass *createX86IssueVZeroUpperPass();
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
52 /// Return a pass that pads short functions with NOOPs.
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
53 /// This will prevent a stall when returning on the Atom.
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
54 FunctionPass *createX86PadShortFunctions();
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
56 /// Return a pass that selectively replaces certain instructions (like add,
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
57 /// sub, inc, dec, some shifts, and some multiplies) by equivalent LEA
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
58 /// instructions, in order to eliminate execution delays in some processors.
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 FunctionPass *createX86FixupLEAs();
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
61 /// Return a pass that removes redundant LEA instructions and redundant address
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
62 /// recalculations.
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
63 FunctionPass *createX86OptimizeLEAs();
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
64
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
65 /// Return a pass that transforms setcc + movzx pairs into xor + setcc.
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
66 FunctionPass *createX86FixupSetCC();
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
67
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
68 /// Return a pass that expands WinAlloca pseudo-instructions.
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
69 FunctionPass *createX86WinAllocaExpander();
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
70
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
71 /// Return a pass that optimizes the code-size of x86 call sequences. This is
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
72 /// done by replacing esp-relative movs with pushes.
83
60c9769439b8 LLVM 3.7
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
73 FunctionPass *createX86CallFrameOptimization();
60c9769439b8 LLVM 3.7
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
74
100
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
75 /// Return an IR pass that inserts EH registration stack objects and explicit
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
76 /// EH state updates. This pass must run after EH preparation, which does
7d135dc70f03 LLVM 3.9
Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
77 /// Windows-specific but architecture-neutral preparation.
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
78 FunctionPass *createX86WinEHStatePass();
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
79
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
80 /// Return a Machine IR pass that expands X86-specific pseudo
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
81 /// instructions into a sequence of actual instructions. This pass
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
82 /// must run after prologue/epilogue insertion and before lowering
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
83 /// the MachineInstr to MC.
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
84 FunctionPass *createX86ExpandPseudoPass();
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
85
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
86 /// This pass converts X86 cmov instructions into branch when profitable.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
87 FunctionPass *createX86CmovConverterPass();
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
88
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
89 /// Return a Machine IR pass that selectively replaces
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
90 /// certain byte and word instructions by equivalent 32 bit instructions,
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
91 /// in order to eliminate partial register usage, false dependences on
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
92 /// the upper portions of registers, and to save code size.
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
93 FunctionPass *createX86FixupBWInsts();
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
94
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
95 /// Return a Machine IR pass that reassigns instruction chains from one domain
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
96 /// to another, when profitable.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
97 FunctionPass *createX86DomainReassignmentPass();
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
98
120
1172e4bd9c6f update 4.0.0
mir3636
parents: 100
diff changeset
99 void initializeFixupBWInstPassPass(PassRegistry &);
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
100
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
101 /// This pass replaces EVEX encoded of AVX-512 instructiosn by VEX
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
102 /// encoding when possible in order to reduce code size.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
103 FunctionPass *createX86EvexToVexInsts();
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
104
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
105 InstructionSelector *createX86InstructionSelector(const X86TargetMachine &TM,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
106 X86Subtarget &,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
107 X86RegisterBankInfo &);
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
108
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
109 void initializeEvexToVexInstPassPass(PassRegistry &);
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
110
0
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 } // End llvm namespace
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112
95c75e76d11b LLVM 3.4
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 #endif