LLVM API Documentation

SelectionDAG.cpp File Reference

#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/Constants.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/GlobalAlias.h"
#include "llvm/GlobalVariable.h"
#include "llvm/Intrinsics.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/CallingConv.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include <algorithm>
#include <cmath>

Include dependency graph for SelectionDAG.cpp:

Go to the source code of this file.

Functions

static SDVTList makeVTList (const MVT *VTs, unsigned NumVTs)
static const fltSemantics * MVTToAPFloatSemantics (MVT VT)
static int isSignedOp (ISD::CondCode Opcode)
static void AddNodeIDOpcode (FoldingSetNodeID &ID, unsigned OpC)
static void AddNodeIDValueTypes (FoldingSetNodeID &ID, SDVTList VTList)
static void AddNodeIDOperands (FoldingSetNodeID &ID, const SDValue *Ops, unsigned NumOps)
static void AddNodeIDOperands (FoldingSetNodeID &ID, const SDUse *Ops, unsigned NumOps)
static void AddNodeIDNode (FoldingSetNodeID &ID, unsigned short OpC, SDVTList VTList, const SDValue *OpList, unsigned N)
static void AddNodeIDCustom (FoldingSetNodeID &ID, const SDNode *N)
static void AddNodeIDNode (FoldingSetNodeID &ID, const SDNode *N)
static unsigned encodeMemSDNodeFlags (int ConvType, ISD::MemIndexedMode AM, bool isVolatile, unsigned Alignment)
static bool doNotCSE (SDNode *N)
 doNotCSE - Return true if CSE should not be performed for this node.
static SDValue getMemsetValue (SDValue Value, MVT VT, SelectionDAG &DAG)
static SDValue getMemsetStringVal (MVT VT, SelectionDAG &DAG, const TargetLowering &TLI, std::string &Str, unsigned Offset)
static SDValue getMemBasePlusOffset (SDValue Base, unsigned Offset, SelectionDAG &DAG)
static bool isMemSrcFromString (SDValue Src, std::string &Str)
static bool MeetsMaxMemopRequirement (std::vector< MVT > &MemOps, SDValue Dst, SDValue Src, unsigned Limit, uint64_t Size, unsigned &Align, std::string &Str, bool &isSrcStr, SelectionDAG &DAG, const TargetLowering &TLI)
static SDValue getMemcpyLoadsAndStores (SelectionDAG &DAG, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, unsigned Align, bool AlwaysInline, const Value *DstSV, uint64_t DstSVOff, const Value *SrcSV, uint64_t SrcSVOff)
static SDValue getMemmoveLoadsAndStores (SelectionDAG &DAG, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, unsigned Align, bool AlwaysInline, const Value *DstSV, uint64_t DstSVOff, const Value *SrcSV, uint64_t SrcSVOff)
static SDValue getMemsetStores (SelectionDAG &DAG, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, unsigned Align, const Value *DstSV, uint64_t DstSVOff)
bool operator< (const UseMemo &L, const UseMemo &R)
 operator< - Sort Memos by User.
static void findPredecessor (SDNode *N, const SDNode *P, bool &found, SmallPtrSet< SDNode *, 32 > &Visited)
static void DumpNodes (const SDNode *N, unsigned indent, const SelectionDAG *G)


Function Documentation

static void AddNodeIDCustom ( FoldingSetNodeID &  ID,
const SDNode *  N 
) [static]

AddNodeIDCustom - If this is an SDNode with special info, add this info to the NodeID data.

Definition at line 360 of file SelectionDAG.cpp.

References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::MachineConstantPoolValue::AddSelectionDAGCSEId(), llvm::ISD::ARG_FLAGS, llvm::ISD::ATOMIC_CMP_SWAP, llvm::ISD::ATOMIC_LOAD_ADD, llvm::ISD::ATOMIC_LOAD_AND, llvm::ISD::ATOMIC_LOAD_MAX, llvm::ISD::ATOMIC_LOAD_MIN, llvm::ISD::ATOMIC_LOAD_NAND, llvm::ISD::ATOMIC_LOAD_OR, llvm::ISD::ATOMIC_LOAD_SUB, llvm::ISD::ATOMIC_LOAD_UMAX, llvm::ISD::ATOMIC_LOAD_UMIN, llvm::ISD::ATOMIC_LOAD_XOR, llvm::ISD::ATOMIC_SWAP, llvm::ISD::BasicBlock, llvm::Call, llvm::ISD::CALL, llvm::ISD::Constant, llvm::ISD::ConstantFP, llvm::ISD::ConstantPool, CP, llvm::ISD::DBG_STOPPOINT, llvm::ISD::FrameIndex, llvm::ConstantPoolSDNode::getAlignment(), llvm::SelectionDAG::getArgFlags(), llvm::SelectionDAG::getBasicBlock(), llvm::CallSDNode::getCallingConv(), llvm::DbgStopPointSDNode::getColumn(), llvm::DbgStopPointSDNode::getCompileUnit(), llvm::ConstantPoolSDNode::getConstVal(), llvm::GlobalAddressSDNode::getGlobal(), llvm::DbgStopPointSDNode::getLine(), llvm::ConstantPoolSDNode::getMachineCPVal(), llvm::MemSDNode::getMemoryVT(), llvm::ConstantPoolSDNode::getOffset(), llvm::GlobalAddressSDNode::getOffset(), llvm::SDNode::getOpcode(), llvm::MVT::getRawBits(), llvm::MemSDNode::getRawSubclassData(), llvm::ISD::GlobalAddress, llvm::ISD::GlobalTLSAddress, llvm::ConstantPoolSDNode::isMachineConstantPoolEntry(), llvm::CallSDNode::isVarArg(), llvm::ISD::JumpTable, llvm::ISD::LOAD, llvm::ISD::MEMOPERAND, llvm::MachineMemOperand::Profile(), llvm::ISD::Register, llvm::ISD::SRCVALUE, llvm::ISD::STORE, llvm::ISD::TargetConstant, llvm::ISD::TargetConstantFP, llvm::ISD::TargetConstantPool, llvm::ISD::TargetFrameIndex, llvm::ISD::TargetGlobalAddress, llvm::ISD::TargetGlobalTLSAddress, and llvm::ISD::TargetJumpTable.

Referenced by AddNodeIDNode().

static void AddNodeIDNode ( FoldingSetNodeID &  ID,
const SDNode *  N 
) [static]

AddNodeIDNode - Generic routine for adding a nodes info to the NodeID data.

Definition at line 464 of file SelectionDAG.cpp.

References AddNodeIDCustom(), AddNodeIDOpcode(), AddNodeIDOperands(), AddNodeIDValueTypes(), llvm::SDNode::getNumOperands(), llvm::SDNode::getOpcode(), llvm::SDNode::getVTList(), and llvm::SDNode::op_begin().

static void AddNodeIDNode ( FoldingSetNodeID &  ID,
unsigned short  OpC,
SDVTList  VTList,
const SDValue *  OpList,
unsigned  N 
) [static]

static void AddNodeIDOpcode ( FoldingSetNodeID &  ID,
unsigned  OpC 
) [static]

AddNodeIDOpcode - Add the node opcode to the NodeID data.

Definition at line 320 of file SelectionDAG.cpp.

References llvm::FoldingSetNodeID::AddInteger().

Referenced by AddNodeIDNode().

static void AddNodeIDOperands ( FoldingSetNodeID &  ID,
const SDUse *  Ops,
unsigned  NumOps 
) [static]

AddNodeIDOperands - Various routines for adding operands to the NodeID data.

Definition at line 342 of file SelectionDAG.cpp.

References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::SDUse::getNode(), and llvm::SDUse::getResNo().

static void AddNodeIDOperands ( FoldingSetNodeID &  ID,
const SDValue *  Ops,
unsigned  NumOps 
) [static]

AddNodeIDOperands - Various routines for adding operands to the NodeID data.

Definition at line 332 of file SelectionDAG.cpp.

References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::SDValue::getNode(), and llvm::SDValue::getResNo().

Referenced by AddNodeIDNode().

static void AddNodeIDValueTypes ( FoldingSetNodeID &  ID,
SDVTList  VTList 
) [static]

AddNodeIDValueTypes - Value type lists are intern'd so we can represent them solely with their pointer.

Definition at line 326 of file SelectionDAG.cpp.

References llvm::FoldingSetNodeID::AddPointer(), and llvm::SDVTList::VTs.

Referenced by AddNodeIDNode().

static bool doNotCSE ( SDNode *  N  )  [static]

static void DumpNodes ( const SDNode *  N,
unsigned  indent,
const SelectionDAG *  G 
) [static]

Definition at line 6032 of file SelectionDAG.cpp.

static unsigned encodeMemSDNodeFlags ( int  ConvType,
ISD::MemIndexedMode  AM,
bool  isVolatile,
unsigned  Alignment 
) [inline, static]

encodeMemSDNodeFlags - Generic routine for computing a value for use in the CSE map that carries alignment, volatility, indexing mode, and extension/truncation information.

Definition at line 480 of file SelectionDAG.cpp.

References llvm::Log2_32().

Referenced by llvm::SelectionDAG::getLoad(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTruncStore(), and llvm::MemSDNode::MemSDNode().

static void findPredecessor ( SDNode *  N,
const SDNode *  P,
bool &  found,
SmallPtrSet< SDNode *, 32 > &  Visited 
) [static]

static SDValue getMemBasePlusOffset ( SDValue  Base,
unsigned  Offset,
SelectionDAG &  DAG 
) [static]

static SDValue getMemcpyLoadsAndStores ( SelectionDAG &  DAG,
SDValue  Chain,
SDValue  Dst,
SDValue  Src,
uint64_t  Size,
unsigned  Align,
bool  AlwaysInline,
const Value *  DstSV,
uint64_t  DstSVOff,
const Value *  SrcSV,
uint64_t  SrcSVOff 
) [static]

static SDValue getMemmoveLoadsAndStores ( SelectionDAG &  DAG,
SDValue  Chain,
SDValue  Dst,
SDValue  Src,
uint64_t  Size,
unsigned  Align,
bool  AlwaysInline,
const Value *  DstSV,
uint64_t  DstSVOff,
const Value *  SrcSV,
uint64_t  SrcSVOff 
) [static]

static SDValue getMemsetStores ( SelectionDAG &  DAG,
SDValue  Chain,
SDValue  Dst,
SDValue  Src,
uint64_t  Size,
unsigned  Align,
const Value *  DstSV,
uint64_t  DstSVOff 
) [static]

static SDValue getMemsetStringVal ( MVT  VT,
SelectionDAG &  DAG,
const TargetLowering &  TLI,
std::string &  Str,
unsigned  Offset 
) [static]

static SDValue getMemsetValue ( SDValue  Value,
MVT  VT,
SelectionDAG &  DAG 
) [static]

static bool isMemSrcFromString ( SDValue  Src,
std::string &  Str 
) [static]

static int isSignedOp ( ISD::CondCode  Opcode  )  [static]

isSignedOp - For an integer comparison, return 1 if the comparison is a signed operation and 2 if the result is an unsigned comparison. Return zero if the operation does not depend on the sign of the input (setne and seteq).

Definition at line 242 of file SelectionDAG.cpp.

References llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, and llvm::ISD::SETULT.

Referenced by llvm::ISD::getSetCCAndOperation(), and llvm::ISD::getSetCCOrOperation().

static SDVTList makeVTList ( const MVT *  VTs,
unsigned  NumVTs 
) [static]

makeVTList - Return an instance of the SDVTList struct initialized with the specified members.

Definition at line 47 of file SelectionDAG.cpp.

Referenced by llvm::SelectionDAG::getMemIntrinsicNode(), llvm::SelectionDAG::getNode(), and llvm::SelectionDAG::getVTList().

static bool MeetsMaxMemopRequirement ( std::vector< MVT > &  MemOps,
SDValue  Dst,
SDValue  Src,
unsigned  Limit,
uint64_t  Size,
unsigned &  Align,
std::string &  Str,
bool &  isSrcStr,
SelectionDAG &  DAG,
const TargetLowering &  TLI 
) [static]

static const fltSemantics* MVTToAPFloatSemantics ( MVT  VT  )  [static]

bool @561::operator< ( const UseMemo &  L,
const UseMemo &  R 
) [static]

operator< - Sort Memos by User.

Definition at line 5179 of file SelectionDAG.cpp.


Variable Documentation

Definition at line 5174 of file SelectionDAG.cpp.

Definition at line 5175 of file SelectionDAG.cpp.

Definition at line 5173 of file SelectionDAG.cpp.

Referenced by ChangeCalleesToFastCall(), and RemoveNestAttribute().