blob: fbec6626d99db60cab2e6568b531962a6a5e5e7a [file] [log] [blame]
Chris Lattnerd92fb002002-10-25 22:55:53 +00001//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
Misha Brukmanc88330a2005-04-21 23:38:14 +00002//
John Criswell29265fe2003-10-21 15:17:13 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukmanc88330a2005-04-21 23:38:14 +00007//
John Criswell29265fe2003-10-21 15:17:13 +00008//===----------------------------------------------------------------------===//
Chris Lattnerd92fb002002-10-25 22:55:53 +00009//
10// This file contains the entry points for global functions defined in the x86
11// target library, as used by the LLVM JIT.
12//
Chris Lattnerd92fb002002-10-25 22:55:53 +000013//===----------------------------------------------------------------------===//
14
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000015#ifndef LLVM_LIB_TARGET_X86_X86_H
16#define LLVM_LIB_TARGET_X86_X86_H
Chris Lattnerd92fb002002-10-25 22:55:53 +000017
Craig Topperc6d4efa2014-03-19 06:53:25 +000018#include "llvm/Support/CodeGen.h"
Bill Wendling026e5d72009-04-29 23:29:43 +000019
Brian Gaeke960707c2003-11-11 22:41:34 +000020namespace llvm {
21
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000022class FunctionPass;
Craig Topperc6d4efa2014-03-19 06:53:25 +000023class ImmutablePass;
Daniel Dunbar40eb7f02010-02-21 21:54:14 +000024class X86TargetMachine;
Chris Lattnerd92fb002002-10-25 22:55:53 +000025
Sanjay Patela6bdd702015-12-07 19:31:34 +000026/// This pass converts a legalized DAG into a X86-specific DAG, ready for
27/// instruction scheduling.
Bruno Cardoso Lopes9fd794b2009-06-01 19:57:37 +000028FunctionPass *createX86ISelDag(X86TargetMachine &TM,
29 CodeGenOpt::Level OptLevel);
Chris Lattnerff9e21c2005-01-07 07:48:33 +000030
Sanjay Patela6bdd702015-12-07 19:31:34 +000031/// This pass initializes a global base register for PIC on x86-32.
Eric Christopher463b84b2014-05-22 01:45:57 +000032FunctionPass* createX86GlobalBaseRegPass();
Dan Gohmand7b5ce32010-07-10 09:00:22 +000033
Sanjay Patela6bdd702015-12-07 19:31:34 +000034/// This pass combines multiple accesses to local-dynamic TLS variables so that
35/// the TLS base address for the module is only fetched once per execution path
36/// through the function.
Hans Wennborg789acfb2012-06-01 16:27:21 +000037FunctionPass *createCleanupLocalDynamicTLSPass();
38
Sanjay Patela6bdd702015-12-07 19:31:34 +000039/// This function returns a pass which converts floating-point register
40/// references and pseudo instructions into floating-point stack references and
41/// physical instructions.
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000042FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattner02a3d832002-10-29 22:37:54 +000043
Sanjay Patela6bdd702015-12-07 19:31:34 +000044/// This pass inserts AVX vzeroupper instructions before each call to avoid
45/// transition penalty between functions encoded with AVX and SSE.
Bruno Cardoso Lopes2a3ffb52011-08-23 01:14:17 +000046FunctionPass *createX86IssueVZeroUpperPass();
47
Sanjay Patela6bdd702015-12-07 19:31:34 +000048/// Return a pass that pads short functions with NOOPs.
49/// This will prevent a stall when returning on the Atom.
Preston Gurda01daac2013-01-08 18:27:24 +000050FunctionPass *createX86PadShortFunctions();
Sanjay Patela6bdd702015-12-07 19:31:34 +000051
52/// Return a a pass that selectively replaces certain instructions (like add,
53/// sub, inc, dec, some shifts, and some multiplies) by equivalent LEA
54/// instructions, in order to eliminate execution delays in some processors.
Preston Gurd8b7ab4b2013-04-25 20:29:37 +000055FunctionPass *createX86FixupLEAs();
Preston Gurda01daac2013-01-08 18:27:24 +000056
Sanjay Patela6bdd702015-12-07 19:31:34 +000057/// Return a pass that removes redundant address recalculations.
Alexey Bataev7cf32472015-12-04 10:53:15 +000058FunctionPass *createX86OptimizeLEAs();
59
Sanjay Patela6bdd702015-12-07 19:31:34 +000060/// Return a pass that optimizes the code-size of x86 call sequences. This is
61/// done by replacing esp-relative movs with pushes.
Michael Kuperstein13fbd452015-02-01 16:56:04 +000062FunctionPass *createX86CallFrameOptimization();
63
Sanjay Patela6bdd702015-12-07 19:31:34 +000064/// Return an IR pass that inserts EH registration stack objects and explicit
65/// EH state updates. This pass must run after EH preparation, which does
66/// Windows-specific but architecture-neutral preparation.
Reid Kleckner0738a9c2015-05-05 17:44:16 +000067FunctionPass *createX86WinEHStatePass();
68
Quentin Colombet494eb602015-05-22 18:10:47 +000069/// Return a Machine IR pass that expands X86-specific pseudo
70/// instructions into a sequence of actual instructions. This pass
71/// must run after prologue/epilogue insertion and before lowering
72/// the MachineInstr to MC.
73FunctionPass *createX86ExpandPseudoPass();
Alexander Kornienkof00654e2015-06-23 09:49:53 +000074} // End llvm namespace
Chris Lattnerff9e21c2005-01-07 07:48:33 +000075
Chris Lattnerd92fb002002-10-25 22:55:53 +000076#endif