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