blob: 1f9919f1595587dcf15559936c3eef6d8ad1e946 [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
15#ifndef TARGET_X86_H
16#define TARGET_X86_H
17
Evan Cheng7e763d82011-07-25 18:43:53 +000018#include "MCTargetDesc/X86BaseInfo.h"
Evan Cheng3ddfbd32011-07-06 22:01:53 +000019#include "MCTargetDesc/X86MCTargetDesc.h"
Daniel Dunbarca2511d2010-12-20 15:45:51 +000020#include "llvm/Support/DataTypes.h"
Bill Wendling026e5d72009-04-29 23:29:43 +000021#include "llvm/Target/TargetMachine.h"
22
Brian Gaeke960707c2003-11-11 22:41:34 +000023namespace llvm {
24
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000025class FunctionPass;
Daniel Dunbar40eb7f02010-02-21 21:54:14 +000026class JITCodeEmitter;
Daniel Dunbar40eb7f02010-02-21 21:54:14 +000027class X86TargetMachine;
Chris Lattnerd92fb002002-10-25 22:55:53 +000028
Chad Rosier24c19d22012-08-01 18:39:17 +000029/// createX86ISelDag - This pass converts a legalized DAG into a
Chris Lattner76ac0682005-11-15 00:40:23 +000030/// X86-specific DAG, ready for instruction scheduling.
31///
Bruno Cardoso Lopes9fd794b2009-06-01 19:57:37 +000032FunctionPass *createX86ISelDag(X86TargetMachine &TM,
33 CodeGenOpt::Level OptLevel);
Chris Lattnerff9e21c2005-01-07 07:48:33 +000034
Dan Gohmand7b5ce32010-07-10 09:00:22 +000035/// createGlobalBaseRegPass - This pass initializes a global base
36/// register for PIC on x86-32.
37FunctionPass* createGlobalBaseRegPass();
38
Hans Wennborg789acfb2012-06-01 16:27:21 +000039/// createCleanupLocalDynamicTLSPass() - This pass combines multiple accesses
40/// to local-dynamic TLS variables so that the TLS base address for the module
41/// is only fetched once per execution path through the function.
42FunctionPass *createCleanupLocalDynamicTLSPass();
43
Chris Lattner61e11952003-01-13 00:45:29 +000044/// createX86FloatingPointStackifierPass - This function returns a pass which
45/// converts floating point register references and pseudo instructions into
46/// floating point stack references and physical instructions.
Chris Lattner49376432002-12-28 20:26:16 +000047///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000048FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattner02a3d832002-10-29 22:37:54 +000049
Bruno Cardoso Lopes2a3ffb52011-08-23 01:14:17 +000050/// createX86IssueVZeroUpperPass - This pass inserts AVX vzeroupper instructions
51/// before each call to avoid transition penalty between functions encoded with
52/// AVX and SSE.
53FunctionPass *createX86IssueVZeroUpperPass();
54
Chris Lattnerd8312092005-07-11 05:17:48 +000055/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
56/// to the specified MCE object.
Bruno Cardoso Lopes9fd794b2009-06-01 19:57:37 +000057FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
58 JITCodeEmitter &JCE);
Chris Lattnerd8312092005-07-11 05:17:48 +000059
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000060/// createX86EmitCodeToMemory - Returns a pass that converts a register
61/// allocated function into raw machine code in a dynamically
62/// allocated chunk of memory.
Chris Lattnerd92fb002002-10-25 22:55:53 +000063///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000064FunctionPass *createEmitX86CodeToMemory();
Chris Lattnerd92fb002002-10-25 22:55:53 +000065
Chandler Carruth664e3542013-01-07 01:37:14 +000066/// \brief Creates an X86-specific Target Transformation Info pass.
67ImmutablePass *createX86TargetTransformInfoPass(const X86TargetMachine *TM);
68
Preston Gurda01daac2013-01-08 18:27:24 +000069/// createX86PadShortFunctions - Return a pass that pads short functions
70/// with NOOPs. This will prevent a stall when returning on the Atom.
71FunctionPass *createX86PadShortFunctions();
72
Chris Lattnerff9e21c2005-01-07 07:48:33 +000073} // End llvm namespace
74
Chris Lattnerd92fb002002-10-25 22:55:53 +000075#endif