2002-10-26 06:55:53 +08:00
|
|
|
//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
|
2005-04-22 07:38:14 +08:00
|
|
|
//
|
2003-10-21 23:17:13 +08:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-22 07:38:14 +08:00
|
|
|
//
|
2003-10-21 23:17:13 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2002-10-26 06:55:53 +08:00
|
|
|
//
|
|
|
|
// This file contains the entry points for global functions defined in the x86
|
|
|
|
// target library, as used by the LLVM JIT.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_X86_X86_H
|
|
|
|
#define LLVM_LIB_TARGET_X86_X86_H
|
2002-10-26 06:55:53 +08:00
|
|
|
|
2014-03-19 14:53:25 +08:00
|
|
|
#include "llvm/Support/CodeGen.h"
|
2009-04-30 07:29:43 +08:00
|
|
|
|
2003-11-12 06:41:34 +08:00
|
|
|
namespace llvm {
|
|
|
|
|
2003-08-14 02:15:29 +08:00
|
|
|
class FunctionPass;
|
2014-03-19 14:53:25 +08:00
|
|
|
class ImmutablePass;
|
2017-04-06 17:49:34 +08:00
|
|
|
class InstructionSelector;
|
2016-05-07 09:11:10 +08:00
|
|
|
class PassRegistry;
|
2017-04-06 17:49:34 +08:00
|
|
|
class X86RegisterBankInfo;
|
|
|
|
class X86Subtarget;
|
2010-02-22 05:54:14 +08:00
|
|
|
class X86TargetMachine;
|
2002-10-26 06:55:53 +08:00
|
|
|
|
2015-12-08 03:31:34 +08:00
|
|
|
/// This pass converts a legalized DAG into a X86-specific DAG, ready for
|
|
|
|
/// instruction scheduling.
|
2009-06-02 03:57:37 +08:00
|
|
|
FunctionPass *createX86ISelDag(X86TargetMachine &TM,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
2005-01-07 15:48:33 +08:00
|
|
|
|
2015-12-08 03:31:34 +08:00
|
|
|
/// This pass initializes a global base register for PIC on x86-32.
|
2016-01-12 21:34:11 +08:00
|
|
|
FunctionPass *createX86GlobalBaseRegPass();
|
2010-07-10 17:00:22 +08:00
|
|
|
|
2015-12-08 03:31:34 +08:00
|
|
|
/// This pass combines multiple accesses to local-dynamic TLS variables so that
|
|
|
|
/// the TLS base address for the module is only fetched once per execution path
|
|
|
|
/// through the function.
|
2012-06-02 00:27:21 +08:00
|
|
|
FunctionPass *createCleanupLocalDynamicTLSPass();
|
|
|
|
|
2015-12-08 03:31:34 +08:00
|
|
|
/// This function returns a pass which converts floating-point register
|
|
|
|
/// references and pseudo instructions into floating-point stack references and
|
|
|
|
/// physical instructions.
|
2003-08-14 02:15:29 +08:00
|
|
|
FunctionPass *createX86FloatingPointStackifierPass();
|
2002-10-30 06:37:54 +08:00
|
|
|
|
2015-12-08 03:31:34 +08:00
|
|
|
/// This pass inserts AVX vzeroupper instructions before each call to avoid
|
|
|
|
/// transition penalty between functions encoded with AVX and SSE.
|
2011-08-23 09:14:17 +08:00
|
|
|
FunctionPass *createX86IssueVZeroUpperPass();
|
|
|
|
|
2015-12-08 03:31:34 +08:00
|
|
|
/// Return a pass that pads short functions with NOOPs.
|
|
|
|
/// This will prevent a stall when returning on the Atom.
|
2013-01-09 02:27:24 +08:00
|
|
|
FunctionPass *createX86PadShortFunctions();
|
2015-12-08 03:31:34 +08:00
|
|
|
|
2016-01-12 21:34:11 +08:00
|
|
|
/// Return a pass that selectively replaces certain instructions (like add,
|
2015-12-08 03:31:34 +08:00
|
|
|
/// sub, inc, dec, some shifts, and some multiplies) by equivalent LEA
|
|
|
|
/// instructions, in order to eliminate execution delays in some processors.
|
2013-04-26 04:29:37 +08:00
|
|
|
FunctionPass *createX86FixupLEAs();
|
2013-01-09 02:27:24 +08:00
|
|
|
|
2016-01-13 19:30:44 +08:00
|
|
|
/// Return a pass that removes redundant LEA instructions and redundant address
|
|
|
|
/// recalculations.
|
2015-12-04 18:53:15 +08:00
|
|
|
FunctionPass *createX86OptimizeLEAs();
|
|
|
|
|
2016-07-08 06:50:23 +08:00
|
|
|
/// Return a pass that transforms setcc + movzx pairs into xor + setcc.
|
|
|
|
FunctionPass *createX86FixupSetCC();
|
|
|
|
|
2016-05-19 00:10:17 +08:00
|
|
|
/// Return a pass that expands WinAlloca pseudo-instructions.
|
|
|
|
FunctionPass *createX86WinAllocaExpander();
|
|
|
|
|
2015-12-08 03:31:34 +08:00
|
|
|
/// Return a pass that optimizes the code-size of x86 call sequences. This is
|
|
|
|
/// done by replacing esp-relative movs with pushes.
|
2015-02-02 00:56:04 +08:00
|
|
|
FunctionPass *createX86CallFrameOptimization();
|
|
|
|
|
2015-12-08 03:31:34 +08:00
|
|
|
/// Return an IR pass that inserts EH registration stack objects and explicit
|
|
|
|
/// EH state updates. This pass must run after EH preparation, which does
|
|
|
|
/// Windows-specific but architecture-neutral preparation.
|
2015-05-06 01:44:16 +08:00
|
|
|
FunctionPass *createX86WinEHStatePass();
|
|
|
|
|
2015-05-23 02:10:47 +08:00
|
|
|
/// Return a Machine IR pass that expands X86-specific pseudo
|
|
|
|
/// instructions into a sequence of actual instructions. This pass
|
|
|
|
/// must run after prologue/epilogue insertion and before lowering
|
|
|
|
/// the MachineInstr to MC.
|
|
|
|
FunctionPass *createX86ExpandPseudoPass();
|
2016-02-12 03:43:04 +08:00
|
|
|
|
2017-07-17 01:39:56 +08:00
|
|
|
/// This pass converts X86 cmov instructions into branch when profitable.
|
|
|
|
FunctionPass *createX86CmovConverterPass();
|
|
|
|
|
2016-02-12 03:43:04 +08:00
|
|
|
/// Return a Machine IR pass that selectively replaces
|
|
|
|
/// certain byte and word instructions by equivalent 32 bit instructions,
|
|
|
|
/// in order to eliminate partial register usage, false dependences on
|
|
|
|
/// the upper portions of registers, and to save code size.
|
|
|
|
FunctionPass *createX86FixupBWInsts();
|
2016-05-07 09:11:10 +08:00
|
|
|
|
|
|
|
void initializeFixupBWInstPassPass(PassRegistry &);
|
2016-12-28 18:12:48 +08:00
|
|
|
|
|
|
|
/// This pass replaces EVEX ecnoded of AVX-512 instructiosn by VEX
|
|
|
|
/// encoding when possible in order to reduce code size.
|
|
|
|
FunctionPass *createX86EvexToVexInsts();
|
|
|
|
|
[globalisel][tablegen] Import SelectionDAG's rule predicates and support the equivalent in GIRule.
Summary:
The SelectionDAG importer now imports rules with Predicate's attached via
Requires, PredicateControl, etc. These predicates are implemented as
bitset's to allow multiple predicates to be tested together. However,
unlike the MC layer subtarget features, each target only pays for it's own
predicates (e.g. AArch64 doesn't have 192 feature bits just because X86
needs a lot).
Both AArch64 and X86 derive at least one predicate from the MachineFunction
or Function so they must re-initialize AvailableFeatures before each
function. They also declare locals in <Target>InstructionSelector so that
computeAvailableFeatures() can use the code from SelectionDAG without
modification.
Reviewers: rovka, qcolombet, aditya_nandakumar, t.p.northover, ab
Reviewed By: rovka
Subscribers: aemerson, rengolin, dberris, kristof.beyls, llvm-commits, igorb
Differential Revision: https://reviews.llvm.org/D31418
llvm-svn: 300993
2017-04-21 23:59:56 +08:00
|
|
|
InstructionSelector *createX86InstructionSelector(const X86TargetMachine &TM,
|
|
|
|
X86Subtarget &,
|
2017-04-06 17:49:34 +08:00
|
|
|
X86RegisterBankInfo &);
|
|
|
|
|
2016-12-28 18:12:48 +08:00
|
|
|
void initializeEvexToVexInstPassPass(PassRegistry &);
|
|
|
|
|
2015-06-23 17:49:53 +08:00
|
|
|
} // End llvm namespace
|
2005-01-07 15:48:33 +08:00
|
|
|
|
2002-10-26 06:55:53 +08:00
|
|
|
#endif
|