Chris Lattner | d92fb00 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 1 | //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===// |
Misha Brukman | c88330a | 2005-04-21 23:38:14 +0000 | [diff] [blame] | 2 | // |
John Criswell | 29265fe | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | c88330a | 2005-04-21 23:38:14 +0000 | [diff] [blame] | 7 | // |
John Criswell | 29265fe | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | d92fb00 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 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 | // |
Chris Lattner | d92fb00 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef TARGET_X86_H |
| 16 | #define TARGET_X86_H |
| 17 | |
Evan Cheng | 7e763d8 | 2011-07-25 18:43:53 +0000 | [diff] [blame] | 18 | #include "MCTargetDesc/X86BaseInfo.h" |
Evan Cheng | 3ddfbd3 | 2011-07-06 22:01:53 +0000 | [diff] [blame] | 19 | #include "MCTargetDesc/X86MCTargetDesc.h" |
Daniel Dunbar | ca2511d | 2010-12-20 15:45:51 +0000 | [diff] [blame] | 20 | #include "llvm/Support/DataTypes.h" |
Bill Wendling | 026e5d7 | 2009-04-29 23:29:43 +0000 | [diff] [blame] | 21 | #include "llvm/Target/TargetMachine.h" |
| 22 | |
Brian Gaeke | 960707c | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 23 | namespace llvm { |
| 24 | |
Brian Gaeke | 1a6f2b8 | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 25 | class FunctionPass; |
Daniel Dunbar | 40eb7f0 | 2010-02-21 21:54:14 +0000 | [diff] [blame] | 26 | class JITCodeEmitter; |
Daniel Dunbar | 40eb7f0 | 2010-02-21 21:54:14 +0000 | [diff] [blame] | 27 | class X86TargetMachine; |
Chris Lattner | d92fb00 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 28 | |
Chad Rosier | 24c19d2 | 2012-08-01 18:39:17 +0000 | [diff] [blame] | 29 | /// createX86ISelDag - This pass converts a legalized DAG into a |
Chris Lattner | 76ac068 | 2005-11-15 00:40:23 +0000 | [diff] [blame] | 30 | /// X86-specific DAG, ready for instruction scheduling. |
| 31 | /// |
Bruno Cardoso Lopes | 9fd794b | 2009-06-01 19:57:37 +0000 | [diff] [blame] | 32 | FunctionPass *createX86ISelDag(X86TargetMachine &TM, |
| 33 | CodeGenOpt::Level OptLevel); |
Chris Lattner | ff9e21c | 2005-01-07 07:48:33 +0000 | [diff] [blame] | 34 | |
Dan Gohman | d7b5ce3 | 2010-07-10 09:00:22 +0000 | [diff] [blame] | 35 | /// createGlobalBaseRegPass - This pass initializes a global base |
| 36 | /// register for PIC on x86-32. |
| 37 | FunctionPass* createGlobalBaseRegPass(); |
| 38 | |
Hans Wennborg | 789acfb | 2012-06-01 16:27:21 +0000 | [diff] [blame] | 39 | /// 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. |
| 42 | FunctionPass *createCleanupLocalDynamicTLSPass(); |
| 43 | |
Chris Lattner | 61e1195 | 2003-01-13 00:45:29 +0000 | [diff] [blame] | 44 | /// 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 Lattner | 4937643 | 2002-12-28 20:26:16 +0000 | [diff] [blame] | 47 | /// |
Brian Gaeke | 1a6f2b8 | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 48 | FunctionPass *createX86FloatingPointStackifierPass(); |
Chris Lattner | 02a3d83 | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 49 | |
Bruno Cardoso Lopes | 2a3ffb5 | 2011-08-23 01:14:17 +0000 | [diff] [blame] | 50 | /// createX86IssueVZeroUpperPass - This pass inserts AVX vzeroupper instructions |
| 51 | /// before each call to avoid transition penalty between functions encoded with |
| 52 | /// AVX and SSE. |
| 53 | FunctionPass *createX86IssueVZeroUpperPass(); |
| 54 | |
Chris Lattner | d831209 | 2005-07-11 05:17:48 +0000 | [diff] [blame] | 55 | /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code |
| 56 | /// to the specified MCE object. |
Bruno Cardoso Lopes | 9fd794b | 2009-06-01 19:57:37 +0000 | [diff] [blame] | 57 | FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM, |
| 58 | JITCodeEmitter &JCE); |
Chris Lattner | d831209 | 2005-07-11 05:17:48 +0000 | [diff] [blame] | 59 | |
Brian Gaeke | 1a6f2b8 | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 60 | /// createX86EmitCodeToMemory - Returns a pass that converts a register |
| 61 | /// allocated function into raw machine code in a dynamically |
| 62 | /// allocated chunk of memory. |
Chris Lattner | d92fb00 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 63 | /// |
Brian Gaeke | 1a6f2b8 | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 64 | FunctionPass *createEmitX86CodeToMemory(); |
Chris Lattner | d92fb00 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 65 | |
Chandler Carruth | 664e354 | 2013-01-07 01:37:14 +0000 | [diff] [blame] | 66 | /// \brief Creates an X86-specific Target Transformation Info pass. |
| 67 | ImmutablePass *createX86TargetTransformInfoPass(const X86TargetMachine *TM); |
| 68 | |
Preston Gurd | a01daac | 2013-01-08 18:27:24 +0000 | [diff] [blame] | 69 | /// createX86PadShortFunctions - Return a pass that pads short functions |
| 70 | /// with NOOPs. This will prevent a stall when returning on the Atom. |
| 71 | FunctionPass *createX86PadShortFunctions(); |
| 72 | |
Chris Lattner | ff9e21c | 2005-01-07 07:48:33 +0000 | [diff] [blame] | 73 | } // End llvm namespace |
| 74 | |
Chris Lattner | d92fb00 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 75 | #endif |