LLVM  3.7.0
Macros | Enumerations | Functions | Variables
X86ISelDAGToDAG.cpp File Reference
#include "X86.h"
#include "X86InstrBuilder.h"
#include "X86MachineFunctionInfo.h"
#include "X86RegisterInfo.h"
#include "X86Subtarget.h"
#include "X86TargetMachine.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include <stdint.h>
#include "X86GenDAGISel.inc"
Include dependency graph for X86ISelDAGToDAG.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "x86-isel"
 

Enumerations

enum  AtomicOpc {
  ADD, SUB, INC, DEC,
  OR, AND, XOR, AtomicOpcEnd
}
 Atomic opcode table. More...
 
enum  AtomicSz {
  ConstantI8, I8, SextConstantI16, ConstantI16,
  I16, SextConstantI32, ConstantI32, I32,
  SextConstantI64, ConstantI64, I64, AtomicSzEnd
}
 

Functions

 STATISTIC (NumLoadMoved,"Number of loads moved below TokenFactor")
 
static void MoveBelowOrigChain (SelectionDAG *CurDAG, SDValue Load, SDValue Call, SDValue OrigChain)
 MoveBelowCallOrigChain - Replace the original chain operand of the call with load's chain operand and move load below the call's chain operand. More...
 
static bool isCalleeLoad (SDValue Callee, SDValue &Chain, bool HasCallSeq)
 isCalleeLoad - Return true if call address is a load and it can be moved below CALLSEQ_START and the chains leading up to the call. More...
 
static bool isDispSafeForFrameIndex (int64_t Val)
 
static void InsertDAGNode (SelectionDAG &DAG, SDValue Pos, SDValue N)
 
static bool FoldMaskAndShiftToExtract (SelectionDAG &DAG, SDValue N, uint64_t Mask, SDValue Shift, SDValue X, X86ISelAddressMode &AM)
 
static bool FoldMaskedShiftToScaledMask (SelectionDAG &DAG, SDValue N, uint64_t Mask, SDValue Shift, SDValue X, X86ISelAddressMode &AM)
 
static bool FoldMaskAndShiftToScale (SelectionDAG &DAG, SDValue N, uint64_t Mask, SDValue Shift, SDValue X, X86ISelAddressMode &AM)
 
static SDValue getAtomicLoadArithTargetConstant (SelectionDAG *CurDAG, SDLoc dl, enum AtomicOpc &Op, MVT NVT, SDValue Val, const X86Subtarget *Subtarget)
 
static bool HasNoSignedComparisonUses (SDNode *N)
 HasNoSignedComparisonUses - Test whether the given X86ISD::CMP node has any uses which require the SF or OF bits to be accurate. More...
 
static bool isLoadIncOrDecStore (StoreSDNode *StoreNode, unsigned Opc, SDValue StoredVal, SelectionDAG *CurDAG, LoadSDNode *&LoadNode, SDValue &InputChain)
 isLoadIncOrDecStore - Check whether or not the chain ending in StoreNode is suitable for doing the {load; increment or decrement; store} to modify transformation. More...
 
static unsigned getFusedLdStOpcode (EVT &LdVT, unsigned Opc)
 getFusedLdStOpcode - Get the appropriate X86 opcode for an in memory increment or decrement. More...
 

Variables

static const uint16_t AtomicOpcTbl [AtomicOpcEnd][AtomicSzEnd]
 

Macro Definition Documentation

#define DEBUG_TYPE   "x86-isel"

Definition at line 40 of file X86ISelDAGToDAG.cpp.

Enumeration Type Documentation

enum AtomicOpc

Atomic opcode table.

Enumerator
ADD 
SUB 
INC 
DEC 
OR 
AND 
XOR 
AtomicOpcEnd 

Definition at line 1649 of file X86ISelDAGToDAG.cpp.

enum AtomicSz
Enumerator
ConstantI8 
I8 
SextConstantI16 
ConstantI16 
I16 
SextConstantI32 
ConstantI32 
I32 
SextConstantI64 
ConstantI64 
I64 
AtomicSzEnd 

Definition at line 1660 of file X86ISelDAGToDAG.cpp.

Function Documentation

static bool FoldMaskAndShiftToExtract ( SelectionDAG DAG,
SDValue  N,
uint64_t  Mask,
SDValue  Shift,
SDValue  X,
X86ISelAddressMode &  AM 
)
static
static bool FoldMaskAndShiftToScale ( SelectionDAG DAG,
SDValue  N,
uint64_t  Mask,
SDValue  Shift,
SDValue  X,
X86ISelAddressMode &  AM 
)
static
static bool FoldMaskedShiftToScaledMask ( SelectionDAG DAG,
SDValue  N,
uint64_t  Mask,
SDValue  Shift,
SDValue  X,
X86ISelAddressMode &  AM 
)
static
static SDValue getAtomicLoadArithTargetConstant ( SelectionDAG CurDAG,
SDLoc  dl,
enum AtomicOpc Op,
MVT  NVT,
SDValue  Val,
const X86Subtarget Subtarget 
)
static
static unsigned getFusedLdStOpcode ( EVT LdVT,
unsigned  Opc 
)
static

getFusedLdStOpcode - Get the appropriate X86 opcode for an in memory increment or decrement.

Opc should be X86ISD::DEC or X86ISD::INC.

Definition at line 2086 of file X86ISelDAGToDAG.cpp.

References llvm::X86ISD::DEC, llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, llvm::MVT::i8, llvm::X86ISD::INC, and llvm_unreachable.

static bool HasNoSignedComparisonUses ( SDNode N)
static

HasNoSignedComparisonUses - Test whether the given X86ISD::CMP node has any uses which require the SF or OF bits to be accurate.

Definition at line 1938 of file X86ISelDAGToDAG.cpp.

References llvm::ISD::CopyToReg, getReg(), llvm::SDNode::use_begin(), and llvm::SDNode::use_end().

static void InsertDAGNode ( SelectionDAG DAG,
SDValue  Pos,
SDValue  N 
)
static
static bool isCalleeLoad ( SDValue  Callee,
SDValue Chain,
bool  HasCallSeq 
)
static

isCalleeLoad - Return true if call address is a load and it can be moved below CALLSEQ_START and the chains leading up to the call.

Return the CALLSEQ_START by reference as a second output. In the case of a tail call, there isn't a callseq node between the call chain and the load.

Definition at line 426 of file X86ISelDAGToDAG.cpp.

References llvm::ISD::CALLSEQ_START, llvm::dyn_cast(), llvm::LSBaseSDNode::getAddressingMode(), llvm::LoadSDNode::getExtensionType(), llvm::SDValue::getNode(), llvm::SDValue::getNumOperands(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValue(), llvm::SDValue::hasOneUse(), llvm::SDValue::isOperandOf(), llvm::MemSDNode::isVolatile(), llvm::AArch64DB::LD, llvm::ISD::NON_EXTLOAD, llvm::ISD::TokenFactor, and llvm::ISD::UNINDEXED.

static bool isDispSafeForFrameIndex ( int64_t  Val)
static

Definition at line 605 of file X86ISelDAGToDAG.cpp.

static bool isLoadIncOrDecStore ( StoreSDNode StoreNode,
unsigned  Opc,
SDValue  StoredVal,
SelectionDAG CurDAG,
LoadSDNode *&  LoadNode,
SDValue InputChain 
)
static
static void MoveBelowOrigChain ( SelectionDAG CurDAG,
SDValue  Load,
SDValue  Call,
SDValue  OrigChain 
)
static
STATISTIC ( NumLoadMoved  ,
"Number of loads moved below TokenFactor"   
)

Variable Documentation

const uint16_t AtomicOpcTbl[AtomicOpcEnd][AtomicSzEnd]
static

Definition at line 1675 of file X86ISelDAGToDAG.cpp.