• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 TARGET_X86_H
16 #define TARGET_X86_H
17 
18 #include "llvm/Support/CodeGen.h"
19 
20 namespace llvm {
21 
22 class FunctionPass;
23 class ImmutablePass;
24 class JITCodeEmitter;
25 class X86TargetMachine;
26 
27 /// createX86AtomicExpandPass - This pass expands atomic operations that cannot
28 /// be handled natively in terms of a loop using cmpxchg.
29 FunctionPass *createX86AtomicExpandPass(const X86TargetMachine *TM);
30 
31 /// createX86ISelDag - This pass converts a legalized DAG into a
32 /// X86-specific DAG, ready for instruction scheduling.
33 ///
34 FunctionPass *createX86ISelDag(X86TargetMachine &TM,
35                                CodeGenOpt::Level OptLevel);
36 
37 /// createX86GlobalBaseRegPass - This pass initializes a global base
38 /// register for PIC on x86-32.
39 FunctionPass* createX86GlobalBaseRegPass();
40 
41 /// createCleanupLocalDynamicTLSPass() - This pass combines multiple accesses
42 /// to local-dynamic TLS variables so that the TLS base address for the module
43 /// is only fetched once per execution path through the function.
44 FunctionPass *createCleanupLocalDynamicTLSPass();
45 
46 /// createX86FloatingPointStackifierPass - This function returns a pass which
47 /// converts floating point register references and pseudo instructions into
48 /// floating point stack references and physical instructions.
49 ///
50 FunctionPass *createX86FloatingPointStackifierPass();
51 
52 /// createX86IssueVZeroUpperPass - This pass inserts AVX vzeroupper instructions
53 /// before each call to avoid transition penalty between functions encoded with
54 /// AVX and SSE.
55 FunctionPass *createX86IssueVZeroUpperPass();
56 
57 /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
58 /// to the specified MCE object.
59 FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
60                                           JITCodeEmitter &JCE);
61 
62 /// createX86EmitCodeToMemory - Returns a pass that converts a register
63 /// allocated function into raw machine code in a dynamically
64 /// allocated chunk of memory.
65 ///
66 FunctionPass *createEmitX86CodeToMemory();
67 
68 /// \brief Creates an X86-specific Target Transformation Info pass.
69 ImmutablePass *createX86TargetTransformInfoPass(const X86TargetMachine *TM);
70 
71 /// createX86PadShortFunctions - Return a pass that pads short functions
72 /// with NOOPs. This will prevent a stall when returning on the Atom.
73 FunctionPass *createX86PadShortFunctions();
74 /// createX86FixupLEAs - Return a a pass that selectively replaces
75 /// certain instructions (like add, sub, inc, dec, some shifts,
76 /// and some multiplies) by equivalent LEA instructions, in order
77 /// to eliminate execution delays in some Atom processors.
78 FunctionPass *createX86FixupLEAs();
79 
80 } // End llvm namespace
81 
82 #endif
83