blob: 8b0a4cf477f83807038611a30547caffdf2cc09e [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
Chad Rosier24c19d22012-08-01 18:39:17 +000026/// createX86ISelDag - This pass converts a legalized DAG into a
Chris Lattner76ac0682005-11-15 00:40:23 +000027/// X86-specific DAG, ready for instruction scheduling.
28///
Bruno Cardoso Lopes9fd794b2009-06-01 19:57:37 +000029FunctionPass *createX86ISelDag(X86TargetMachine &TM,
30 CodeGenOpt::Level OptLevel);
Chris Lattnerff9e21c2005-01-07 07:48:33 +000031
Eric Christopher463b84b2014-05-22 01:45:57 +000032/// createX86GlobalBaseRegPass - This pass initializes a global base
Dan Gohmand7b5ce32010-07-10 09:00:22 +000033/// register for PIC on x86-32.
Eric Christopher463b84b2014-05-22 01:45:57 +000034FunctionPass* createX86GlobalBaseRegPass();
Dan Gohmand7b5ce32010-07-10 09:00:22 +000035
Hans Wennborg789acfb2012-06-01 16:27:21 +000036/// createCleanupLocalDynamicTLSPass() - This pass combines multiple accesses
37/// to local-dynamic TLS variables so that the TLS base address for the module
38/// is only fetched once per execution path through the function.
39FunctionPass *createCleanupLocalDynamicTLSPass();
40
Chris Lattner61e11952003-01-13 00:45:29 +000041/// createX86FloatingPointStackifierPass - This function returns a pass which
42/// converts floating point register references and pseudo instructions into
43/// floating point stack references and physical instructions.
Chris Lattner49376432002-12-28 20:26:16 +000044///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000045FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattner02a3d832002-10-29 22:37:54 +000046
Bruno Cardoso Lopes2a3ffb52011-08-23 01:14:17 +000047/// createX86IssueVZeroUpperPass - This pass inserts AVX vzeroupper instructions
48/// before each call to avoid transition penalty between functions encoded with
49/// AVX and SSE.
50FunctionPass *createX86IssueVZeroUpperPass();
51
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000052/// createX86EmitCodeToMemory - Returns a pass that converts a register
53/// allocated function into raw machine code in a dynamically
54/// allocated chunk of memory.
Chris Lattnerd92fb002002-10-25 22:55:53 +000055///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000056FunctionPass *createEmitX86CodeToMemory();
Chris Lattnerd92fb002002-10-25 22:55:53 +000057
Preston Gurda01daac2013-01-08 18:27:24 +000058/// createX86PadShortFunctions - Return a pass that pads short functions
59/// with NOOPs. This will prevent a stall when returning on the Atom.
60FunctionPass *createX86PadShortFunctions();
Preston Gurd8b7ab4b2013-04-25 20:29:37 +000061/// createX86FixupLEAs - Return a a pass that selectively replaces
62/// certain instructions (like add, sub, inc, dec, some shifts,
63/// and some multiplies) by equivalent LEA instructions, in order
64/// to eliminate execution delays in some Atom processors.
65FunctionPass *createX86FixupLEAs();
Preston Gurda01daac2013-01-08 18:27:24 +000066
Michael Kuperstein13fbd452015-02-01 16:56:04 +000067/// createX86CallFrameOptimization - Return a pass that optimizes
68/// the code-size of x86 call sequences. This is done by replacing
69/// esp-relative movs with pushes.
70FunctionPass *createX86CallFrameOptimization();
71
Chris Lattnerff9e21c2005-01-07 07:48:33 +000072} // End llvm namespace
73
Chris Lattnerd92fb002002-10-25 22:55:53 +000074#endif