LLVM  3.7.0
Macros | Functions | Variables
SystemZISelLowering.cpp File Reference
#include "SystemZISelLowering.h"
#include "SystemZCallingConv.h"
#include "SystemZConstantPoolValue.h"
#include "SystemZMachineFunctionInfo.h"
#include "SystemZTargetMachine.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/IR/Intrinsics.h"
#include <cctype>
#include "SystemZGenCallingConv.inc"
Include dependency graph for SystemZISelLowering.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "systemz-lower"
 
#define CONV(X)
 
#define OPCODE(NAME)   case SystemZISD::NAME: return "SystemZISD::" #NAME
 

Functions

static bool is32Bit (EVT VT)
 
static MachineOperand earlyUseOperand (MachineOperand Op)
 
static std::pair< unsigned,
const TargetRegisterClass * > 
parseRegisterNumber (StringRef Constraint, const TargetRegisterClass *RC, const unsigned *Map)
 
static void VerifyVectorType (MVT VT, EVT ArgVT)
 
static void VerifyVectorTypes (const SmallVectorImpl< ISD::InputArg > &Ins)
 
static void VerifyVectorTypes (const SmallVectorImpl< ISD::OutputArg > &Outs)
 
static SDValue convertLocVTToValVT (SelectionDAG &DAG, SDLoc DL, CCValAssign &VA, SDValue Chain, SDValue Value)
 
static SDValue convertValVTToLocVT (SelectionDAG &DAG, SDLoc DL, CCValAssign &VA, SDValue Value)
 
static bool canUseSiblingCall (const CCState &ArgCCInfo, SmallVectorImpl< CCValAssign > &ArgLocs)
 
static bool isIntrinsicWithCCAndChain (SDValue Op, unsigned &Opcode, unsigned &CCValid)
 
static bool isIntrinsicWithCC (SDValue Op, unsigned &Opcode, unsigned &CCValid)
 
static SDValue emitIntrinsicWithChainAndGlue (SelectionDAG &DAG, SDValue Op, unsigned Opcode)
 
static SDValue emitIntrinsicWithGlue (SelectionDAG &DAG, SDValue Op, unsigned Opcode)
 
static unsigned CCMaskForCondCode (ISD::CondCode CC)
 
static IPMConversion getIPMConversion (unsigned CCValid, unsigned CCMask)
 
static void adjustZeroCmp (SelectionDAG &DAG, SDLoc DL, Comparison &C)
 
static void adjustSubwordCmp (SelectionDAG &DAG, SDLoc DL, Comparison &C)
 
static bool isNaturalMemoryOperand (SDValue Op, unsigned ICmpType)
 
static bool shouldSwapCmpOperands (const Comparison &C)
 
static unsigned reverseCCMask (unsigned CCMask)
 
static void adjustForSubtraction (SelectionDAG &DAG, SDLoc DL, Comparison &C)
 
static void adjustForFNeg (Comparison &C)
 
static void adjustForLTGFR (Comparison &C)
 
static void adjustICmpTruncate (SelectionDAG &DAG, SDLoc DL, Comparison &C)
 
static bool isSimpleShift (SDValue N, unsigned &ShiftVal)
 
static unsigned getTestUnderMaskCond (unsigned BitSize, unsigned CCMask, uint64_t Mask, uint64_t CmpVal, unsigned ICmpType)
 
static void adjustForTestUnderMask (SelectionDAG &DAG, SDLoc DL, Comparison &C)
 
static Comparison getIntrinsicCmp (SelectionDAG &DAG, unsigned Opcode, SDValue Call, unsigned CCValid, uint64_t CC, ISD::CondCode Cond)
 
static Comparison getCmp (SelectionDAG &DAG, SDValue CmpOp0, SDValue CmpOp1, ISD::CondCode Cond, SDLoc DL)
 
static SDValue emitCmp (SelectionDAG &DAG, SDLoc DL, Comparison &C)
 
static void lowerMUL_LOHI32 (SelectionDAG &DAG, SDLoc DL, unsigned Extend, SDValue Op0, SDValue Op1, SDValue &Hi, SDValue &Lo)
 
static void lowerGR128Binary (SelectionDAG &DAG, SDLoc DL, EVT VT, unsigned Extend, unsigned Opcode, SDValue Op0, SDValue Op1, SDValue &Even, SDValue &Odd)
 
static SDValue emitSETCC (SelectionDAG &DAG, SDLoc DL, SDValue Glue, unsigned CCValid, unsigned CCMask)
 
static unsigned getVectorComparison (ISD::CondCode CC, bool IsFP)
 
static unsigned getVectorComparisonOrInvert (ISD::CondCode CC, bool IsFP, bool &Invert)
 
static SDValue expandV4F32ToV2F64 (SelectionDAG &DAG, int Start, SDLoc DL, SDValue Op)
 
static SDValue getVectorCmp (SelectionDAG &DAG, unsigned Opcode, SDLoc DL, EVT VT, SDValue CmpOp0, SDValue CmpOp1)
 
static SDValue lowerVectorSETCC (SelectionDAG &DAG, SDLoc DL, EVT VT, ISD::CondCode CC, SDValue CmpOp0, SDValue CmpOp1)
 
static bool isAbsolute (SDValue CmpOp, SDValue Pos, SDValue Neg)
 
static SDValue getAbsolute (SelectionDAG &DAG, SDLoc DL, SDValue Op, bool IsNegative)
 
static SDValue getCCResult (SelectionDAG &DAG, SDNode *After)
 
static bool chooseShuffleOpNos (int *OpNos, unsigned &OpNo0, unsigned &OpNo1)
 
static bool matchPermute (const SmallVectorImpl< int > &Bytes, const Permute &P, unsigned &OpNo0, unsigned &OpNo1)
 
static const Permute * matchPermute (const SmallVectorImpl< int > &Bytes, unsigned &OpNo0, unsigned &OpNo1)
 
static bool matchDoublePermute (const SmallVectorImpl< int > &Bytes, const Permute &P, SmallVectorImpl< int > &Transform)
 
static const Permute * matchDoublePermute (const SmallVectorImpl< int > &Bytes, SmallVectorImpl< int > &Transform)
 
static void getVPermMask (ShuffleVectorSDNode *VSN, SmallVectorImpl< int > &Bytes)
 
static bool getShuffleInput (const SmallVectorImpl< int > &Bytes, unsigned Start, unsigned BytesPerElement, int &Base)
 
static bool isShlDoublePermute (const SmallVectorImpl< int > &Bytes, unsigned &StartIndex, unsigned &OpNo0, unsigned &OpNo1)
 
static SDValue getPermuteNode (SelectionDAG &DAG, SDLoc DL, const Permute &P, SDValue Op0, SDValue Op1)
 
static SDValue getGeneralPermuteNode (SelectionDAG &DAG, SDLoc DL, SDValue *Ops, const SmallVectorImpl< int > &Bytes)
 
static bool isScalarToVector (SDValue Op)
 
static SDValue buildScalarToVector (SelectionDAG &DAG, SDLoc DL, EVT VT, SDValue Value)
 
static SDValue buildMergeScalars (SelectionDAG &DAG, SDLoc DL, EVT VT, SDValue Op0, SDValue Op1)
 
static SDValue joinDwords (SelectionDAG &DAG, SDLoc DL, SDValue Op0, SDValue Op1)
 
static bool tryBuildVectorByteMask (BuildVectorSDNode *BVN, uint64_t &Mask)
 
static SDValue tryBuildVectorReplicate (SelectionDAG &DAG, const SystemZInstrInfo *TII, SDLoc DL, EVT VT, uint64_t Value, unsigned BitsPerElement)
 
static SDValue tryBuildVectorShuffle (SelectionDAG &DAG, BuildVectorSDNode *BVN)
 
static SDValue buildVector (SelectionDAG &DAG, SDLoc DL, EVT VT, SmallVectorImpl< SDValue > &Elems)
 
static bool canTreatAsByteVector (EVT VT)
 
static MachineBasicBlockemitBlockAfter (MachineBasicBlock *MBB)
 
static MachineBasicBlocksplitBlockAfter (MachineInstr *MI, MachineBasicBlock *MBB)
 
static MachineBasicBlocksplitBlockBefore (MachineInstr *MI, MachineBasicBlock *MBB)
 
static unsigned forceReg (MachineInstr *MI, MachineOperand &Base, const SystemZInstrInfo *TII)
 

Variables

static const Permute PermuteForms []
 

Macro Definition Documentation

#define CONV (   X)
Value:
case ISD::SET##X: return SystemZ::CCMASK_CMP_##X; \
case ISD::SETO##X: return SystemZ::CCMASK_CMP_##X; \
case ISD::SETU##X: return SystemZ::CCMASK_CMP_UO | SystemZ::CCMASK_CMP_##X
#define SET(n)
Definition: MD5.cpp:64
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
const unsigned CCMASK_CMP_UO
Definition: SystemZ.h:43

Referenced by CCMaskForCondCode().

#define DEBUG_TYPE   "systemz-lower"

Definition at line 28 of file SystemZISelLowering.cpp.

#define OPCODE (   NAME)    case SystemZISD::NAME: return "SystemZISD::" #NAME

Function Documentation

static void adjustForFNeg ( Comparison &  C)
static

Definition at line 1746 of file SystemZISelLowering.cpp.

References llvm::dyn_cast(), llvm::ISD::FNEG, llvm::SDNode::getOpcode(), I, N, and reverseCCMask().

Referenced by getCmp().

static void adjustForLTGFR ( Comparison &  C)
static
static void adjustForSubtraction ( SelectionDAG DAG,
SDLoc  DL,
Comparison &  C 
)
static
static void adjustForTestUnderMask ( SelectionDAG DAG,
SDLoc  DL,
Comparison &  C 
)
static
static void adjustICmpTruncate ( SelectionDAG DAG,
SDLoc  DL,
Comparison &  C 
)
static
static void adjustSubwordCmp ( SelectionDAG DAG,
SDLoc  DL,
Comparison &  C 
)
static
static void adjustZeroCmp ( SelectionDAG DAG,
SDLoc  DL,
Comparison &  C 
)
static
static SDValue buildMergeScalars ( SelectionDAG DAG,
SDLoc  DL,
EVT  VT,
SDValue  Op0,
SDValue  Op1 
)
static
static SDValue buildScalarToVector ( SelectionDAG DAG,
SDLoc  DL,
EVT  VT,
SDValue  Value 
)
static
static SDValue buildVector ( SelectionDAG DAG,
SDLoc  DL,
EVT  VT,
SmallVectorImpl< SDValue > &  Elems 
)
static
static bool canTreatAsByteVector ( EVT  VT)
static
static bool canUseSiblingCall ( const CCState ArgCCInfo,
SmallVectorImpl< CCValAssign > &  ArgLocs 
)
static
static unsigned CCMaskForCondCode ( ISD::CondCode  CC)
static
static bool chooseShuffleOpNos ( int OpNos,
unsigned OpNo0,
unsigned OpNo1 
)
static

Definition at line 3362 of file SystemZISelLowering.cpp.

Referenced by isShlDoublePermute(), and matchPermute().

static SDValue convertLocVTToValVT ( SelectionDAG DAG,
SDLoc  DL,
CCValAssign VA,
SDValue  Chain,
SDValue  Value 
)
static
static SDValue convertValVTToLocVT ( SelectionDAG DAG,
SDLoc  DL,
CCValAssign VA,
SDValue  Value 
)
static
static MachineOperand earlyUseOperand ( MachineOperand  Op)
static
static MachineBasicBlock* emitBlockAfter ( MachineBasicBlock MBB)
static
static SDValue emitCmp ( SelectionDAG DAG,
SDLoc  DL,
Comparison &  C 
)
static
static SDValue emitIntrinsicWithChainAndGlue ( SelectionDAG DAG,
SDValue  Op,
unsigned  Opcode 
)
static
static SDValue emitIntrinsicWithGlue ( SelectionDAG DAG,
SDValue  Op,
unsigned  Opcode 
)
static
static SDValue emitSETCC ( SelectionDAG DAG,
SDLoc  DL,
SDValue  Glue,
unsigned  CCValid,
unsigned  CCMask 
)
static
static SDValue expandV4F32ToV2F64 ( SelectionDAG DAG,
int  Start,
SDLoc  DL,
SDValue  Op 
)
static
static unsigned forceReg ( MachineInstr MI,
MachineOperand Base,
const SystemZInstrInfo TII 
)
static
static SDValue getAbsolute ( SelectionDAG DAG,
SDLoc  DL,
SDValue  Op,
bool  IsNegative 
)
static
static SDValue getCCResult ( SelectionDAG DAG,
SDNode After 
)
static
static Comparison getCmp ( SelectionDAG DAG,
SDValue  CmpOp0,
SDValue  CmpOp1,
ISD::CondCode  Cond,
SDLoc  DL 
)
static
static SDValue getGeneralPermuteNode ( SelectionDAG DAG,
SDLoc  DL,
SDValue Ops,
const SmallVectorImpl< int > &  Bytes 
)
static
static Comparison getIntrinsicCmp ( SelectionDAG DAG,
unsigned  Opcode,
SDValue  Call,
unsigned  CCValid,
uint64_t  CC,
ISD::CondCode  Cond 
)
static
static IPMConversion getIPMConversion ( unsigned  CCValid,
unsigned  CCMask 
)
static
static SDValue getPermuteNode ( SelectionDAG DAG,
SDLoc  DL,
const Permute &  P,
SDValue  Op0,
SDValue  Op1 
)
static
static bool getShuffleInput ( const SmallVectorImpl< int > &  Bytes,
unsigned  Start,
unsigned  BytesPerElement,
int Base 
)
static
static unsigned getTestUnderMaskCond ( unsigned  BitSize,
unsigned  CCMask,
uint64_t  Mask,
uint64_t  CmpVal,
unsigned  ICmpType 
)
static
static SDValue getVectorCmp ( SelectionDAG DAG,
unsigned  Opcode,
SDLoc  DL,
EVT  VT,
SDValue  CmpOp0,
SDValue  CmpOp1 
)
static
static unsigned getVectorComparison ( ISD::CondCode  CC,
bool  IsFP 
)
static
static unsigned getVectorComparisonOrInvert ( ISD::CondCode  CC,
bool  IsFP,
bool Invert 
)
static

Definition at line 2209 of file SystemZISelLowering.cpp.

References llvm::ISD::getSetCCInverse(), and getVectorComparison().

Referenced by lowerVectorSETCC().

static void getVPermMask ( ShuffleVectorSDNode VSN,
SmallVectorImpl< int > &  Bytes 
)
static
static bool is32Bit ( EVT  VT)
static
static bool isAbsolute ( SDValue  CmpOp,
SDValue  Pos,
SDValue  Neg 
)
static
static bool isIntrinsicWithCC ( SDValue  Op,
unsigned Opcode,
unsigned CCValid 
)
static
static bool isIntrinsicWithCCAndChain ( SDValue  Op,
unsigned Opcode,
unsigned CCValid 
)
static
static bool isNaturalMemoryOperand ( SDValue  Op,
unsigned  ICmpType 
)
static
static bool isScalarToVector ( SDValue  Op)
static
static bool isShlDoublePermute ( const SmallVectorImpl< int > &  Bytes,
unsigned StartIndex,
unsigned OpNo0,
unsigned OpNo1 
)
static

Definition at line 3495 of file SystemZISelLowering.cpp.

References chooseShuffleOpNos(), I, and llvm::SystemZ::VectorBytes.

Referenced by getGeneralPermuteNode().

static bool isSimpleShift ( SDValue  N,
unsigned ShiftVal 
)
static
static SDValue joinDwords ( SelectionDAG DAG,
SDLoc  DL,
SDValue  Op0,
SDValue  Op1 
)
static
static void lowerGR128Binary ( SelectionDAG DAG,
SDLoc  DL,
EVT  VT,
unsigned  Extend,
unsigned  Opcode,
SDValue  Op0,
SDValue  Op1,
SDValue Even,
SDValue Odd 
)
static
static void lowerMUL_LOHI32 ( SelectionDAG DAG,
SDLoc  DL,
unsigned  Extend,
SDValue  Op0,
SDValue  Op1,
SDValue Hi,
SDValue Lo 
)
static
static SDValue lowerVectorSETCC ( SelectionDAG DAG,
SDLoc  DL,
EVT  VT,
ISD::CondCode  CC,
SDValue  CmpOp0,
SDValue  CmpOp1 
)
static
static bool matchDoublePermute ( const SmallVectorImpl< int > &  Bytes,
const Permute &  P,
SmallVectorImpl< int > &  Transform 
)
static

Definition at line 3422 of file SystemZISelLowering.cpp.

References llvm::SystemZ::VectorBytes.

Referenced by matchDoublePermute().

static const Permute* matchDoublePermute ( const SmallVectorImpl< int > &  Bytes,
SmallVectorImpl< int > &  Transform 
)
static

Definition at line 3444 of file SystemZISelLowering.cpp.

References matchDoublePermute(), and P.

static bool matchPermute ( const SmallVectorImpl< int > &  Bytes,
const Permute &  P,
unsigned OpNo0,
unsigned OpNo1 
)
static

Definition at line 3385 of file SystemZISelLowering.cpp.

References chooseShuffleOpNos(), I, and llvm::SystemZ::VectorBytes.

Referenced by matchPermute().

static const Permute* matchPermute ( const SmallVectorImpl< int > &  Bytes,
unsigned OpNo0,
unsigned OpNo1 
)
static

Definition at line 3409 of file SystemZISelLowering.cpp.

References matchPermute(), and P.

static std::pair<unsigned, const TargetRegisterClass *> parseRegisterNumber ( StringRef  Constraint,
const TargetRegisterClass RC,
const unsigned Map 
)
static
static unsigned reverseCCMask ( unsigned  CCMask)
static
static bool shouldSwapCmpOperands ( const Comparison &  C)
static
static MachineBasicBlock* splitBlockAfter ( MachineInstr MI,
MachineBasicBlock MBB 
)
static
static MachineBasicBlock* splitBlockBefore ( MachineInstr MI,
MachineBasicBlock MBB 
)
static
static bool tryBuildVectorByteMask ( BuildVectorSDNode BVN,
uint64_t &  Mask 
)
static
static SDValue tryBuildVectorReplicate ( SelectionDAG DAG,
const SystemZInstrInfo TII,
SDLoc  DL,
EVT  VT,
uint64_t  Value,
unsigned  BitsPerElement 
)
static
static SDValue tryBuildVectorShuffle ( SelectionDAG DAG,
BuildVectorSDNode BVN 
)
static
static void VerifyVectorType ( MVT  VT,
EVT  ArgVT 
)
static
static void VerifyVectorTypes ( const SmallVectorImpl< ISD::InputArg > &  Ins)
static
static void VerifyVectorTypes ( const SmallVectorImpl< ISD::OutputArg > &  Outs)
static

Variable Documentation

const Permute PermuteForms[]
static

Definition at line 3313 of file SystemZISelLowering.cpp.