LLVM API Documentation

X86ISelLowering.cpp File Reference

#include "X86.h"
#include "X86InstrBuilder.h"
#include "X86ISelLowering.h"
#include "X86TargetMachine.h"
#include "llvm/CallingConv.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalAlias.h"
#include "llvm/GlobalVariable.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/LLVMContext.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/VectorExtras.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/raw_ostream.h"
#include "X86GenCallingConv.inc"

Include dependency graph for X86ISelLowering.cpp:

Go to the source code of this file.

Functions

static SDValue getMOVL (SelectionDAG &DAG, DebugLoc dl, EVT VT, SDValue V1, SDValue V2)
static TargetLoweringObjectFile * createTLOF (X86TargetMachine &TM)
static void getMaxByValAlign (const Type *Ty, unsigned &MaxAlign)
static bool CallIsStructReturn (const SmallVectorImpl< ISD::OutputArg > &Outs)
static bool ArgsAreStructReturn (const SmallVectorImpl< ISD::InputArg > &Ins)
static SDValue CreateCopyOfByValArgument (SDValue Src, SDValue Dst, SDValue Chain, ISD::ArgFlagsTy Flags, SelectionDAG &DAG, DebugLoc dl)
static SDValue EmitTailCallStoreRetAddr (SelectionDAG &DAG, MachineFunction &MF, SDValue Chain, SDValue RetAddrFrIdx, bool Is64Bit, int FPDiff, DebugLoc dl)
static unsigned TranslateX86CC (ISD::CondCode SetCCOpcode, bool isFP, SDValue &LHS, SDValue &RHS, SelectionDAG &DAG)
static bool hasFPCMov (unsigned X86CC)
static bool isUndefOrInRange (int Val, int Low, int Hi)
static bool isUndefOrEqual (int Val, int CmpVal)
static bool isPSHUFDMask (const SmallVectorImpl< int > &Mask, EVT VT)
static bool isPSHUFHWMask (const SmallVectorImpl< int > &Mask, EVT VT)
static bool isPSHUFLWMask (const SmallVectorImpl< int > &Mask, EVT VT)
static bool isSHUFPMask (const SmallVectorImpl< int > &Mask, EVT VT)
static bool isCommutedSHUFPMask (const SmallVectorImpl< int > &Mask, EVT VT)
static bool isCommutedSHUFP (ShuffleVectorSDNode *N)
static bool isUNPCKLMask (const SmallVectorImpl< int > &Mask, EVT VT, bool V2IsSplat=false)
static bool isUNPCKHMask (const SmallVectorImpl< int > &Mask, EVT VT, bool V2IsSplat=false)
static bool isUNPCKL_v_undef_Mask (const SmallVectorImpl< int > &Mask, EVT VT)
static bool isUNPCKH_v_undef_Mask (const SmallVectorImpl< int > &Mask, EVT VT)
static bool isMOVLMask (const SmallVectorImpl< int > &Mask, EVT VT)
static bool isCommutedMOVLMask (const SmallVectorImpl< int > &Mask, EVT VT, bool V2IsSplat=false, bool V2IsUndef=false)
static bool isCommutedMOVL (ShuffleVectorSDNode *N, bool V2IsSplat=false, bool V2IsUndef=false)
static SDValue CommuteVectorShuffle (ShuffleVectorSDNode *SVOp, SelectionDAG &DAG)
static void CommuteVectorShuffleMask (SmallVectorImpl< int > &Mask, EVT VT)
static bool ShouldXformToMOVHLPS (ShuffleVectorSDNode *Op)
static bool isScalarLoadToVector (SDNode *N, LoadSDNode **LD=NULL)
static bool ShouldXformToMOVLP (SDNode *V1, SDNode *V2, ShuffleVectorSDNode *Op)
static bool isSplatVector (SDNode *N)
static bool isZeroShuffle (ShuffleVectorSDNode *N)
static SDValue getZeroVector (EVT VT, bool HasSSE2, SelectionDAG &DAG, DebugLoc dl)
static SDValue getOnesVector (EVT VT, SelectionDAG &DAG, DebugLoc dl)
static SDValue NormalizeMask (ShuffleVectorSDNode *SVOp, SelectionDAG &DAG)
static SDValue getUnpackl (SelectionDAG &DAG, DebugLoc dl, EVT VT, SDValue V1, SDValue V2)
 getUnpackl - Returns a vector_shuffle node for an unpackl operation.
static SDValue getUnpackh (SelectionDAG &DAG, DebugLoc dl, EVT VT, SDValue V1, SDValue V2)
 getUnpackhMask - Returns a vector_shuffle node for an unpackh operation.
static SDValue PromoteSplat (ShuffleVectorSDNode *SV, SelectionDAG &DAG, bool HasSSE2)
 PromoteSplat - Promote a splat of v4f32, v8i16 or v16i8 to v4i32.
static SDValue getShuffleVectorZeroOrUndef (SDValue V2, unsigned Idx, bool isZero, bool HasSSE2, SelectionDAG &DAG)
static unsigned getNumOfConsecutiveZeros (ShuffleVectorSDNode *SVOp, int NumElems, bool Low, SelectionDAG &DAG)
static bool isVectorShift (ShuffleVectorSDNode *SVOp, SelectionDAG &DAG, bool &isLeft, SDValue &ShVal, unsigned &ShAmt)
static SDValue LowerBuildVectorv16i8 (SDValue Op, unsigned NonZeros, unsigned NumNonZero, unsigned NumZero, SelectionDAG &DAG, TargetLowering &TLI)
static SDValue LowerBuildVectorv8i16 (SDValue Op, unsigned NonZeros, unsigned NumNonZero, unsigned NumZero, SelectionDAG &DAG, TargetLowering &TLI)
static SDValue getVShift (bool isLeft, EVT VT, SDValue SrcOp, unsigned NumBits, SelectionDAG &DAG, const TargetLowering &TLI, DebugLoc dl)
static SDValue LowerVECTOR_SHUFFLEv8i16 (ShuffleVectorSDNode *SVOp, SelectionDAG &DAG, X86TargetLowering &TLI)
static SDValue LowerVECTOR_SHUFFLEv16i8 (ShuffleVectorSDNode *SVOp, SelectionDAG &DAG, X86TargetLowering &TLI)
static SDValue RewriteAsNarrowerShuffle (ShuffleVectorSDNode *SVOp, SelectionDAG &DAG, TargetLowering &TLI, DebugLoc dl)
static SDValue getVZextMovL (EVT VT, EVT OpVT, SDValue SrcOp, SelectionDAG &DAG, const X86Subtarget *Subtarget, DebugLoc dl)
static SDValue LowerVECTOR_SHUFFLE_4wide (ShuffleVectorSDNode *SVOp, SelectionDAG &DAG)
static SDValue GetTLSADDR (SelectionDAG &DAG, SDValue Chain, GlobalAddressSDNode *GA, SDValue *InFlag, const EVT PtrVT, unsigned ReturnReg, unsigned char OperandFlags)
static SDValue LowerToTLSGeneralDynamicModel32 (GlobalAddressSDNode *GA, SelectionDAG &DAG, const EVT PtrVT)
static SDValue LowerToTLSGeneralDynamicModel64 (GlobalAddressSDNode *GA, SelectionDAG &DAG, const EVT PtrVT)
static SDValue LowerToTLSExecModel (GlobalAddressSDNode *GA, SelectionDAG &DAG, const EVT PtrVT, TLSModel::Model model, bool is64Bit)
static bool isX86LogicalCmp (SDValue Op)
static bool isAndOrOfSetCCs (SDValue Op, unsigned &Opc)
static bool isXor1OfSetCC (SDValue Op)
static bool isBaseAlignmentOfN (unsigned N, SDNode *Base, const TargetLowering &TLI)
static bool EltsFromConsecutiveLoads (ShuffleVectorSDNode *N, unsigned NumElems, EVT EVT, LoadSDNode *&LDBase, unsigned &LastLoadedElt, SelectionDAG &DAG, MachineFrameInfo *MFI, const TargetLowering &TLI)
static SDValue PerformShuffleCombine (SDNode *N, SelectionDAG &DAG, const TargetLowering &TLI)
static SDValue PerformSELECTCombine (SDNode *N, SelectionDAG &DAG, const X86Subtarget *Subtarget)
 PerformSELECTCombine - Do target-specific dag combines on SELECT nodes.
static SDValue PerformCMOVCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI)
 Optimize X86ISD::CMOV [LHS, RHS, CONDCODE (e.g. X86::COND_NE), CONDVAL].
static SDValue PerformMulCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI)
static SDValue PerformShiftCombine (SDNode *N, SelectionDAG &DAG, const X86Subtarget *Subtarget)
static SDValue PerformSTORECombine (SDNode *N, SelectionDAG &DAG, const X86Subtarget *Subtarget)
 PerformSTORECombine - Do target-specific dag combines on STORE nodes.
static SDValue PerformFORCombine (SDNode *N, SelectionDAG &DAG)
static SDValue PerformFANDCombine (SDNode *N, SelectionDAG &DAG)
 PerformFANDCombine - Do target-specific dag combines on X86ISD::FAND nodes.
static SDValue PerformBTCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI)
static SDValue PerformVZEXT_MOVLCombine (SDNode *N, SelectionDAG &DAG)
static SDValue PerformMEMBARRIERCombine (SDNode *N, SelectionDAG &DAG)
static bool LowerToBSwap (CallInst *CI)

Variables

static cl::opt< bool > DisableMMX ("disable-mmx", cl::Hidden, cl::desc("Disable use of MMX"))


Function Documentation

static bool ArgsAreStructReturn ( const SmallVectorImpl< ISD::InputArg > &  Ins  )  [static]

ArgsAreStructReturn - Determines whether a function uses struct return semantics.

Definition at line 1249 of file X86ISelLowering.cpp.

References llvm::SmallVectorImpl< T >::empty().

static bool CallIsStructReturn ( const SmallVectorImpl< ISD::OutputArg > &  Outs  )  [static]

CallIsStructReturn - Determines whether a call uses struct return semantics.

Definition at line 1239 of file X86ISelLowering.cpp.

References llvm::SmallVectorImpl< T >::empty().

static SDValue CommuteVectorShuffle ( ShuffleVectorSDNode *  SVOp,
SelectionDAG &  DAG 
) [static]

static void CommuteVectorShuffleMask ( SmallVectorImpl< int > &  Mask,
EVT  VT 
) [static]

CommuteVectorShuffleMask - Change values in a shuffle permute mask assuming the two vector operands have swapped position.

Definition at line 2793 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements().

Referenced by LowerVECTOR_SHUFFLE_4wide().

static SDValue CreateCopyOfByValArgument ( SDValue  Src,
SDValue  Dst,
SDValue  Chain,
ISD::ArgFlagsTy  Flags,
SelectionDAG &  DAG,
DebugLoc  dl 
) [static]

CreateCopyOfByValArgument - Make a copy of an aggregate at address specified by "Src" to address "Dst" with size and alignment information specified by the specific parameter attribute. The copy will be passed as a byval function parameter.

Definition at line 1309 of file X86ISelLowering.cpp.

References llvm::ISD::ArgFlagsTy::getByValAlign(), llvm::ISD::ArgFlagsTy::getByValSize(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getMemcpy(), and llvm::MVT::i32.

static TargetLoweringObjectFile* createTLOF ( X86TargetMachine &  TM  )  [static]

Definition at line 54 of file X86ISelLowering.cpp.

References llvm::TargetMachine::getSubtarget(), and llvm_unreachable.

static bool EltsFromConsecutiveLoads ( ShuffleVectorSDNode *  N,
unsigned  NumElems,
EVT  EVT,
LoadSDNode *&  LDBase,
unsigned &  LastLoadedElt,
SelectionDAG &  DAG,
MachineFrameInfo *  MFI,
const TargetLowering &  TLI 
) [static]

static SDValue EmitTailCallStoreRetAddr ( SelectionDAG &  DAG,
MachineFunction &  MF,
SDValue  Chain,
SDValue  RetAddrFrIdx,
bool  Is64Bit,
int  FPDiff,
DebugLoc  dl 
) [static]

EmitTailCallStoreRetAddr - Emit a store of the return adress if tail call optimization is performed and it is required (FPDiff!=0).

Definition at line 1637 of file X86ISelLowering.cpp.

References llvm::MachineFrameInfo::CreateFixedObject(), llvm::PseudoSourceValue::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::SelectionDAG::getStore(), llvm::MVT::i32, and llvm::MVT::i64.

static void getMaxByValAlign ( const Type *  Ty,
unsigned &  MaxAlign 
) [static]

getMaxByValAlign - Helper for getByValTypeAlignment to determine the desired ByVal argument alignment.

Definition at line 972 of file X86ISelLowering.cpp.

Referenced by llvm::X86TargetLowering::getByValTypeAlignment().

static SDValue getMOVL ( SelectionDAG &  DAG,
DebugLoc  dl,
EVT  VT,
SDValue  V1,
SDValue  V2 
) [static]

getMOVLMask - Returns a vector_shuffle mask for an movs{s|d}, movd operation of specified width.

Definition at line 2967 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), and llvm::SmallVectorImpl< T >::push_back().

static unsigned getNumOfConsecutiveZeros ( ShuffleVectorSDNode *  SVOp,
int  NumElems,
bool  Low,
SelectionDAG &  DAG 
) [static]

getNumOfConsecutiveZeros - Return the number of elements in a result of a shuffle that is zero.

Definition at line 3054 of file X86ISelLowering.cpp.

References llvm::ShuffleVectorSDNode::getMaskElt(), llvm::SDValue::getNode(), llvm::SelectionDAG::getShuffleScalarElt(), Idx, Index, and llvm::X86::isZeroNode().

Referenced by isVectorShift().

static SDValue getOnesVector ( EVT  VT,
SelectionDAG &  DAG,
DebugLoc  dl 
) [static]

static SDValue getShuffleVectorZeroOrUndef ( SDValue  V2,
unsigned  Idx,
bool  isZero,
bool  HasSSE2,
SelectionDAG &  DAG 
) [static]

getShuffleVectorZeroOrUndef - Return a vector_shuffle of the specified vector of zero or undef vector. This produces a shuffle where the low element of V2 is swizzled into the zero/undef vector, landing at element Idx. This produces a shuffle mask like 4,1,2,3 (idx=0) or 0,1,2,4 (idx=3).

Definition at line 3037 of file X86ISelLowering.cpp.

References llvm::SDValue::getDebugLoc(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValueType(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), getZeroVector(), llvm::SmallVectorImpl< T >::push_back(), and V1.

static SDValue GetTLSADDR ( SelectionDAG &  DAG,
SDValue  Chain,
GlobalAddressSDNode *  GA,
SDValue *  InFlag,
const EVT  PtrVT,
unsigned  ReturnReg,
unsigned char  OperandFlags 
) [static]

static SDValue getUnpackh ( SelectionDAG &  DAG,
DebugLoc  dl,
EVT  VT,
SDValue  V1,
SDValue  V2 
) [static]

getUnpackhMask - Returns a vector_shuffle node for an unpackh operation.

Definition at line 2990 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), and llvm::SmallVectorImpl< T >::push_back().

Referenced by PromoteSplat().

static SDValue getUnpackl ( SelectionDAG &  DAG,
DebugLoc  dl,
EVT  VT,
SDValue  V1,
SDValue  V2 
) [static]

getUnpackl - Returns a vector_shuffle node for an unpackl operation.

Definition at line 2978 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), and llvm::SmallVectorImpl< T >::push_back().

Referenced by PromoteSplat().

static SDValue getVShift ( bool  isLeft,
EVT  VT,
SDValue  SrcOp,
unsigned  NumBits,
SelectionDAG &  DAG,
const TargetLowering &  TLI,
DebugLoc  dl 
) [static]

static SDValue getVZextMovL ( EVT  VT,
EVT  OpVT,
SDValue  SrcOp,
SelectionDAG &  DAG,
const X86Subtarget *  Subtarget,
DebugLoc  dl 
) [static]

static SDValue getZeroVector ( EVT  VT,
bool  HasSSE2,
SelectionDAG &  DAG,
DebugLoc  dl 
) [static]

static bool hasFPCMov ( unsigned  X86CC  )  [static]

hasFPCMov - is there a floating point cmov for the specific X86 condition code. Current x86 isa includes the following FP cmov instructions: fcmovb, fcomvbe, fcomve, fcmovu, fcmovae, fcmova, fcmovne, fcmovnu.

Definition at line 2267 of file X86ISelLowering.cpp.

References llvm::X86::COND_A, llvm::X86::COND_AE, llvm::X86::COND_B, llvm::X86::COND_BE, llvm::X86::COND_E, llvm::X86::COND_NE, llvm::X86::COND_NP, and llvm::X86::COND_P.

static bool isAndOrOfSetCCs ( SDValue  Op,
unsigned &  Opc 
) [static]

static bool isBaseAlignmentOfN ( unsigned  N,
SDNode *  Base,
const TargetLowering &  TLI 
) [static]

static bool isCommutedMOVL ( ShuffleVectorSDNode *  N,
bool  V2IsSplat = false,
bool  V2IsUndef = false 
) [static]

static bool isCommutedMOVLMask ( const SmallVectorImpl< int > &  Mask,
EVT  VT,
bool  V2IsSplat = false,
bool  V2IsUndef = false 
) [static]

isCommutedMOVL - Returns true if the shuffle mask is except the reverse of what x86 movss want. X86 movs requires the lowest element to be lowest element of vector 2 and the other elements to come from vector 1 in order.

Definition at line 2619 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), isUndefOrEqual(), and isUndefOrInRange().

Referenced by isCommutedMOVL(), and llvm::X86TargetLowering::isVectorClearMaskLegal().

static bool isCommutedSHUFP ( ShuffleVectorSDNode *  N  )  [static]

static bool isCommutedSHUFPMask ( const SmallVectorImpl< int > &  Mask,
EVT  VT 
) [static]

isCommutedSHUFP - Returns true if the shuffle mask is exactly the reverse of what x86 shuffles want. x86 shuffles requires the lower half elements to come from vector 1 (which would equal the dest.) and the upper half to come from vector 2.

Definition at line 2392 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), and isUndefOrInRange().

Referenced by isCommutedSHUFP(), and llvm::X86TargetLowering::isVectorClearMaskLegal().

static bool isMOVLMask ( const SmallVectorImpl< int > &  Mask,
EVT  VT 
) [static]

isMOVLMask - Return true if the specified VECTOR_SHUFFLE operand specifies a shuffle of elements that is suitable for input to MOVSS, MOVSD, and MOVD, i.e. setting the lowest element.

Definition at line 2594 of file X86ISelLowering.cpp.

References llvm::EVT::getSizeInBits(), llvm::EVT::getVectorElementType(), llvm::EVT::getVectorNumElements(), and isUndefOrEqual().

Referenced by llvm::X86::isMOVLMask(), llvm::X86TargetLowering::isShuffleMaskLegal(), and llvm::X86TargetLowering::isVectorClearMaskLegal().

static bool isPSHUFDMask ( const SmallVectorImpl< int > &  Mask,
EVT  VT 
) [static]

isPSHUFDMask - Return true if the node specifies a shuffle of elements that is suitable for input to PSHUFD or PSHUFW. That is, it doesn't reference the second operand.

Definition at line 2300 of file X86ISelLowering.cpp.

References llvm::MVT::v2f64, llvm::MVT::v2i64, llvm::MVT::v4f32, llvm::MVT::v4i16, and llvm::MVT::v4i32.

Referenced by llvm::X86::isPSHUFDMask(), and llvm::X86TargetLowering::isShuffleMaskLegal().

static bool isPSHUFHWMask ( const SmallVectorImpl< int > &  Mask,
EVT  VT 
) [static]

isPSHUFHWMask - Return true if the node specifies a shuffle of elements that is suitable for input to PSHUFHW.

Definition at line 2316 of file X86ISelLowering.cpp.

References llvm::MVT::v8i16.

Referenced by llvm::X86::isPSHUFHWMask(), and llvm::X86TargetLowering::isShuffleMaskLegal().

static bool isPSHUFLWMask ( const SmallVectorImpl< int > &  Mask,
EVT  VT 
) [static]

isPSHUFLWMask - Return true if the node specifies a shuffle of elements that is suitable for input to PSHUFLW.

Definition at line 2341 of file X86ISelLowering.cpp.

References llvm::MVT::v8i16.

Referenced by llvm::X86::isPSHUFLWMask(), and llvm::X86TargetLowering::isShuffleMaskLegal().

static bool isScalarLoadToVector ( SDNode *  N,
LoadSDNode **  LD = NULL 
) [static]

isScalarLoadToVector - Returns true if the node is a scalar load that is promoted to a vector. It also returns the LoadSDNode by reference if required.

Definition at line 2825 of file X86ISelLowering.cpp.

References llvm::SDValue::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::ISD::isNON_EXTLoad(), and llvm::ISD::SCALAR_TO_VECTOR.

Referenced by getVZextMovL(), and ShouldXformToMOVLP().

static bool isSHUFPMask ( const SmallVectorImpl< int > &  Mask,
EVT  VT 
) [static]

isSHUFPMask - Return true if the specified VECTOR_SHUFFLE operand specifies a shuffle of elements that is suitable for input to SHUFP*.

Definition at line 2366 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), and isUndefOrInRange().

Referenced by llvm::X86TargetLowering::isShuffleMaskLegal(), llvm::X86::isSHUFPMask(), and llvm::X86TargetLowering::isVectorClearMaskLegal().

static bool isSplatVector ( SDNode *  N  )  [static]

isSplatVector - Returns true if N is a BUILD_VECTOR node whose elements are all the same.

Definition at line 2865 of file X86ISelLowering.cpp.

References llvm::ISD::BUILD_VECTOR, llvm::SDNode::getNumOperands(), llvm::SDNode::getOpcode(), and llvm::SDNode::getOperand().

static bool isUndefOrEqual ( int  Val,
int  CmpVal 
) [static]

static bool isUndefOrInRange ( int  Val,
int  Low,
int  Hi 
) [static]

isUndefOrInRange - Return true if Val is undef or if its value falls within the specified range (L, H].

Definition at line 2285 of file X86ISelLowering.cpp.

Referenced by isCommutedMOVLMask(), isCommutedSHUFPMask(), and isSHUFPMask().

static bool isUNPCKH_v_undef_Mask ( const SmallVectorImpl< int > &  Mask,
EVT  VT 
) [static]

isUNPCKH_v_undef_Mask - Special case of isUNPCKHMask for canonical form of vector_shuffle v, v, <2, 6, 3, 7>, i.e. vector_shuffle v, undef, <2, 2, 3, 3>

Definition at line 2569 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), and isUndefOrEqual().

Referenced by llvm::X86TargetLowering::isShuffleMaskLegal(), and llvm::X86::isUNPCKH_v_undef_Mask().

static bool isUNPCKHMask ( const SmallVectorImpl< int > &  Mask,
EVT  VT,
bool  V2IsSplat = false 
) [static]

isUNPCKHMask - Return true if the specified VECTOR_SHUFFLE operand specifies a shuffle of elements that is suitable for input to UNPCKH.

Definition at line 2513 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), and isUndefOrEqual().

Referenced by llvm::X86TargetLowering::isShuffleMaskLegal(), and llvm::X86::isUNPCKHMask().

static bool isUNPCKL_v_undef_Mask ( const SmallVectorImpl< int > &  Mask,
EVT  VT 
) [static]

isUNPCKL_v_undef_Mask - Special case of isUNPCKLMask for canonical form of vector_shuffle v, v, <0, 4, 1, 5>, i.e. vector_shuffle v, undef, <0, 0, 1, 1>

Definition at line 2544 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), and isUndefOrEqual().

Referenced by llvm::X86TargetLowering::isShuffleMaskLegal(), and llvm::X86::isUNPCKL_v_undef_Mask().

static bool isUNPCKLMask ( const SmallVectorImpl< int > &  Mask,
EVT  VT,
bool  V2IsSplat = false 
) [static]

isUNPCKLMask - Return true if the specified VECTOR_SHUFFLE operand specifies a shuffle of elements that is suitable for input to UNPCKL.

Definition at line 2483 of file X86ISelLowering.cpp.

References llvm::EVT::getVectorNumElements(), and isUndefOrEqual().

Referenced by llvm::X86TargetLowering::isShuffleMaskLegal(), and llvm::X86::isUNPCKLMask().

static bool isVectorShift ( ShuffleVectorSDNode *  SVOp,
SelectionDAG &  DAG,
bool &  isLeft,
SDValue &  ShVal,
unsigned &  ShAmt 
) [static]

isVectorShift - Returns true if the shuffle can be implemented as a logical left or right shift of a vector. FIXME: split into pslldqi, psrldqi, palignr variants.

Definition at line 3076 of file X86ISelLowering.cpp.

References llvm::ShuffleVectorSDNode::getMaskElt(), getNumOfConsecutiveZeros(), llvm::SDNode::getOperand(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), and Idx.

static bool isX86LogicalCmp ( SDValue  Op  )  [static]

static bool isXor1OfSetCC ( SDValue  Op  )  [static]

static bool isZeroShuffle ( ShuffleVectorSDNode *  N  )  [static]

isZeroShuffle - Returns true if N is a VECTOR_SHUFFLE that can be resolved to an zero vector. FIXME: move to dag combiner / method on ShuffleVectorSDNode

Definition at line 2879 of file X86ISelLowering.cpp.

References llvm::ISD::BUILD_VECTOR, llvm::ShuffleVectorSDNode::getMaskElt(), llvm::SDValue::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), Idx, llvm::ISD::isBuildVectorAllZeros(), llvm::X86::isZeroNode(), llvm::ISD::UNDEF, and V1.

static SDValue LowerBuildVectorv16i8 ( SDValue  Op,
unsigned  NonZeros,
unsigned  NumNonZero,
unsigned  NumZero,
SelectionDAG &  DAG,
TargetLowering &  TLI 
) [static]

static SDValue LowerBuildVectorv8i16 ( SDValue  Op,
unsigned  NonZeros,
unsigned  NumNonZero,
unsigned  NumZero,
SelectionDAG &  DAG,
TargetLowering &  TLI 
) [static]

static bool LowerToBSwap ( CallInst *  CI  )  [static]

static SDValue LowerToTLSExecModel ( GlobalAddressSDNode *  GA,
SelectionDAG &  DAG,
const EVT  PtrVT,
TLSModel::Model  model,
bool  is64Bit 
) [static]

static SDValue LowerToTLSGeneralDynamicModel32 ( GlobalAddressSDNode *  GA,
SelectionDAG &  DAG,
const EVT  PtrVT 
) [static]

static SDValue LowerToTLSGeneralDynamicModel64 ( GlobalAddressSDNode *  GA,
SelectionDAG &  DAG,
const EVT  PtrVT 
) [static]

static SDValue LowerVECTOR_SHUFFLE_4wide ( ShuffleVectorSDNode *  SVOp,
SelectionDAG &  DAG 
) [static]

static SDValue LowerVECTOR_SHUFFLEv16i8 ( ShuffleVectorSDNode *  SVOp,
SelectionDAG &  DAG,
X86TargetLowering &  TLI 
) [static]

static SDValue LowerVECTOR_SHUFFLEv8i16 ( ShuffleVectorSDNode *  SVOp,
SelectionDAG &  DAG,
X86TargetLowering &  TLI 
) [static]

static SDValue NormalizeMask ( ShuffleVectorSDNode *  SVOp,
SelectionDAG &  DAG 
) [static]

NormalizeMask - V2 is a splat, modify the mask (if needed) so all elements that point to V2 points to its first element.

Definition at line 2945 of file X86ISelLowering.cpp.

References Changed, llvm::SDNode::getDebugLoc(), llvm::ShuffleVectorSDNode::getMask(), llvm::SDNode::getOperand(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), and llvm::SelectionDAG::getVectorShuffle().

static SDValue PerformBTCombine ( SDNode *  N,
SelectionDAG &  DAG,
TargetLowering::DAGCombinerInfo &  DCI 
) [static]

static SDValue PerformCMOVCombine ( SDNode *  N,
SelectionDAG &  DAG,
TargetLowering::DAGCombinerInfo &  DCI 
) [static]

static SDValue PerformFANDCombine ( SDNode *  N,
SelectionDAG &  DAG 
) [static]

PerformFANDCombine - Do target-specific dag combines on X86ISD::FAND nodes.

Definition at line 8727 of file X86ISelLowering.cpp.

References llvm::SDNode::getOperand().

Referenced by llvm::X86TargetLowering::PerformDAGCombine().

static SDValue PerformFORCombine ( SDNode *  N,
SelectionDAG &  DAG 
) [static]

PerformFORCombine - Do target-specific dag combines on X86ISD::FOR and X86ISD::FXOR nodes.

Definition at line 8713 of file X86ISelLowering.cpp.

References llvm::X86ISD::FOR, llvm::X86ISD::FXOR, llvm::SDNode::getOpcode(), and llvm::SDNode::getOperand().

Referenced by llvm::X86TargetLowering::PerformDAGCombine().

static SDValue PerformMEMBARRIERCombine ( SDNode *  N,
SelectionDAG &  DAG 
) [static]

static SDValue PerformMulCombine ( SDNode *  N,
SelectionDAG &  DAG,
TargetLowering::DAGCombinerInfo &  DCI 
) [static]

static SDValue PerformSELECTCombine ( SDNode *  N,
SelectionDAG &  DAG,
const X86Subtarget *  Subtarget 
) [static]

static SDValue PerformShiftCombine ( SDNode *  N,
SelectionDAG &  DAG,
const X86Subtarget *  Subtarget 
) [static]

static SDValue PerformShuffleCombine ( SDNode *  N,
SelectionDAG &  DAG,
const TargetLowering &  TLI 
) [static]

static SDValue PerformSTORECombine ( SDNode *  N,
SelectionDAG &  DAG,
const X86Subtarget *  Subtarget 
) [static]

static SDValue PerformVZEXT_MOVLCombine ( SDNode *  N,
SelectionDAG &  DAG 
) [static]

static SDValue PromoteSplat ( ShuffleVectorSDNode *  SV,
SelectionDAG &  DAG,
bool  HasSSE2 
) [static]

static SDValue RewriteAsNarrowerShuffle ( ShuffleVectorSDNode *  SVOp,
SelectionDAG &  DAG,
TargetLowering &  TLI,
DebugLoc  dl 
) [static]

RewriteAsNarrowerShuffle - Try rewriting v8i16 and v16i8 shuffles as 4 wide ones, or rewriting v4i32 / v2f32 as 2 wide ones if possible. This can be done when every pair / quad of shuffle mask elements point to elements in the right sequence. e.g. vector_shuffle <>, <>, < 3, 4, | 10, 11, | 0, 1, | 14, 15>

Definition at line 3848 of file X86ISelLowering.cpp.

References llvm::ISD::BIT_CONVERT, llvm::MVT::getIntVectorWithNumElements(), llvm::ShuffleVectorSDNode::getMaskElt(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOperand(), llvm::EVT::getSimpleVT(), llvm::SDNode::getValueType(), llvm::EVT::getVectorElementType(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), llvm::EVT::isInteger(), llvm::SmallVectorImpl< T >::push_back(), Scale, llvm::MVT::SimpleTy, V1, llvm::MVT::v16i8, llvm::MVT::v2f64, llvm::MVT::v2i64, llvm::MVT::v4f32, llvm::MVT::v4i32, and llvm::MVT::v8i16.

static bool ShouldXformToMOVHLPS ( ShuffleVectorSDNode *  Op  )  [static]

ShouldXformToMOVHLPS - Return true if the node should be transformed to match movhlps. The lower half elements should come from upper half of V1 (and in order), and the upper half elements should come from the upper half of V2 (and in order).

Definition at line 2810 of file X86ISelLowering.cpp.

References llvm::ShuffleVectorSDNode::getMaskElt(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), and isUndefOrEqual().

static bool ShouldXformToMOVLP ( SDNode *  V1,
SDNode *  V2,
ShuffleVectorSDNode *  Op 
) [static]

ShouldXformToMOVLP{S|D} - Return true if the node should be transformed to match movlp{s|d}. The lower half elements should come from lower half of V1 (and in order), and the upper half elements should come from the upper half of V2 (and in order). And since V1 will become the source of the MOVLP, it must be either a vector load or a scalar load to vector.

Definition at line 2841 of file X86ISelLowering.cpp.

References llvm::ShuffleVectorSDNode::getMaskElt(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::ISD::isNON_EXTLoad(), isScalarLoadToVector(), and isUndefOrEqual().

static unsigned TranslateX86CC ( ISD::CondCode  SetCCOpcode,
bool  isFP,
SDValue &  LHS,
SDValue &  RHS,
SelectionDAG &  DAG 
) [static]


Variable Documentation

cl::opt<bool> DisableMMX("disable-mmx", cl::Hidden, cl::desc("Disable use of MMX")) [static]