|
LLVM
4.0.0
|
#include "llvm/CodeGen/SelectionDAG.h"#include "SDNodeDbgValue.h"#include "llvm/ADT/APSInt.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 "llvm/Analysis/ValueTracking.h"#include "llvm/CodeGen/MachineBasicBlock.h"#include "llvm/CodeGen/MachineConstantPool.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineModuleInfo.h"#include "llvm/CodeGen/SelectionDAGTargetInfo.h"#include "llvm/IR/CallingConv.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DebugInfo.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalAlias.h"#include "llvm/IR/GlobalVariable.h"#include "llvm/IR/Intrinsics.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/ManagedStatic.h"#include "llvm/Support/MathExtras.h"#include "llvm/Support/Mutex.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetInstrInfo.h"#include "llvm/Target/TargetIntrinsicInfo.h"#include "llvm/Target/TargetLowering.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetOptions.h"#include "llvm/Target/TargetRegisterInfo.h"#include "llvm/Target/TargetSubtargetInfo.h"#include <algorithm>#include <cmath>#include <utility>Go to the source code of this file.
Functions | |
| static SDVTList | makeVTList (const EVT *VTs, unsigned NumVTs) |
| makeVTList - Return an instance of the SDVTList struct initialized with the specified members. More... | |
| static int | isSignedOp (ISD::CondCode Opcode) |
| For an integer comparison, return 1 if the comparison is a signed operation and 2 if the result is an unsigned comparison. More... | |
| static void | AddNodeIDOpcode (FoldingSetNodeID &ID, unsigned OpC) |
| AddNodeIDOpcode - Add the node opcode to the NodeID data. More... | |
| static void | AddNodeIDValueTypes (FoldingSetNodeID &ID, SDVTList VTList) |
| AddNodeIDValueTypes - Value type lists are intern'd so we can represent them solely with their pointer. More... | |
| static void | AddNodeIDOperands (FoldingSetNodeID &ID, ArrayRef< SDValue > Ops) |
| AddNodeIDOperands - Various routines for adding operands to the NodeID data. More... | |
| static void | AddNodeIDOperands (FoldingSetNodeID &ID, ArrayRef< SDUse > Ops) |
| AddNodeIDOperands - Various routines for adding operands to the NodeID data. More... | |
| static void | AddNodeIDNode (FoldingSetNodeID &ID, unsigned short OpC, SDVTList VTList, ArrayRef< SDValue > OpList) |
| static void | AddNodeIDCustom (FoldingSetNodeID &ID, const SDNode *N) |
| If this is an SDNode with special info, add this info to the NodeID data. More... | |
| static void | AddNodeIDNode (FoldingSetNodeID &ID, const SDNode *N) |
| AddNodeIDNode - Generic routine for adding a nodes info to the NodeID data. More... | |
| static bool | doNotCSE (SDNode *N) |
| doNotCSE - Return true if CSE should not be performed for this node. More... | |
| static void | VerifySDNode (SDNode *N) |
| VerifySDNode - Sanity check the given SDNode. Aborts if it is invalid. More... | |
| static void | commuteShuffle (SDValue &N1, SDValue &N2, MutableArrayRef< int > M) |
| Swaps the values of N1 and N2. More... | |
| static const APInt * | getValidShiftAmountConstant (SDValue V) |
| If a SHL/SRA/SRL node has a constant or splat constant shift amount that is less than the element bit-width of the shift node, return it. More... | |
| static SDValue | FoldCONCAT_VECTORS (const SDLoc &DL, EVT VT, ArrayRef< SDValue > Ops, llvm::SelectionDAG &DAG) |
| static std::pair< APInt, bool > | FoldValue (unsigned Opcode, const APInt &C1, const APInt &C2) |
| static SDValue | getMemsetValue (SDValue Value, EVT VT, SelectionDAG &DAG, const SDLoc &dl) |
| getMemsetValue - Vectorized representation of the memset value operand. More... | |
| static SDValue | getMemsetStringVal (EVT VT, const SDLoc &dl, SelectionDAG &DAG, const TargetLowering &TLI, StringRef Str) |
| getMemsetStringVal - Similar to getMemsetValue. More... | |
| static bool | isMemSrcFromString (SDValue Src, StringRef &Str) |
| isMemSrcFromString - Returns true if memcpy source is a string constant. More... | |
| static bool | FindOptimalMemOpLowering (std::vector< EVT > &MemOps, unsigned Limit, uint64_t Size, unsigned DstAlign, unsigned SrcAlign, bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc, bool AllowOverlap, unsigned DstAS, unsigned SrcAS, SelectionDAG &DAG, const TargetLowering &TLI) |
| Determines the optimal series of memory ops to replace the memset / memcpy. More... | |
| static bool | shouldLowerMemFuncForSize (const MachineFunction &MF) |
| static SDValue | getMemcpyLoadsAndStores (SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, unsigned Align, bool isVol, bool AlwaysInline, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) |
| static SDValue | getMemmoveLoadsAndStores (SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, unsigned Align, bool isVol, bool AlwaysInline, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) |
| static SDValue | getMemsetStores (SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, unsigned Align, bool isVol, MachinePointerInfo DstPtrInfo) |
| Lower the call to 'memset' intrinsic function into a series of store operations. More... | |
| static void | checkAddrSpaceIsValidForLibcall (const TargetLowering *TLI, unsigned AS) |
| static MachinePointerInfo | InferPointerInfo (SelectionDAG &DAG, SDValue Ptr, int64_t Offset=0) |
| InferPointerInfo - If the specified ptr/offset is a frame index, infer a MachinePointerInfo record from it. More... | |
| static MachinePointerInfo | InferPointerInfo (SelectionDAG &DAG, SDValue Ptr, SDValue OffsetOp) |
| InferPointerInfo - If the specified ptr/offset is a frame index, infer a MachinePointerInfo record from it. More... | |
| static void | checkForCyclesHelper (const SDNode *N, SmallPtrSetImpl< const SDNode * > &Visited, SmallPtrSetImpl< const SDNode * > &Checked, const llvm::SelectionDAG *DAG) |
Variables | |
| static ManagedStatic< std::set < EVT, EVT::compareRawBits > > | EVTs |
| static ManagedStatic< EVTArray > | SimpleVTArray |
| static ManagedStatic < sys::SmartMutex< true > > | VTMutex |
|
static |
If this is an SDNode with special info, add this info to the NodeID data.
Definition at line 379 of file SelectionDAG.cpp.
References llvm::FoldingSetNodeID::AddBoolean(), llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::MachineConstantPoolValue::addSelectionDAGCSEId(), llvm::ISD::ATOMIC_CMP_SWAP, llvm::ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS, llvm::ISD::ATOMIC_LOAD, 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_STORE, llvm::ISD::ATOMIC_SWAP, llvm::ISD::BasicBlock, llvm::ISD::BlockAddress, C, llvm::ISD::Constant, llvm::ISD::ConstantFP, llvm::ISD::ConstantPool, llvm::HexagonISD::CP, llvm::ISD::ExternalSymbol, llvm::ISD::FrameIndex, llvm::MachinePointerInfo::getAddrSpace(), llvm::ConstantPoolSDNode::getAlignment(), llvm::SelectionDAG::getBasicBlock(), llvm::BlockAddressSDNode::getBlockAddress(), llvm::ConstantSDNode::getConstantIntValue(), llvm::ConstantPoolSDNode::getConstVal(), llvm::GlobalAddressSDNode::getGlobal(), llvm::TargetIndexSDNode::getIndex(), llvm::ConstantPoolSDNode::getMachineCPVal(), llvm::ShuffleVectorSDNode::getMaskElt(), llvm::MemSDNode::getMemoryVT(), llvm::GlobalAddressSDNode::getOffset(), llvm::ConstantPoolSDNode::getOffset(), llvm::TargetIndexSDNode::getOffset(), llvm::BlockAddressSDNode::getOffset(), llvm::SDNode::getOpcode(), llvm::MemSDNode::getPointerInfo(), llvm::EVT::getRawBits(), llvm::MemSDNode::getRawSubclassData(), getReg(), llvm::GlobalAddressSDNode::getTargetFlags(), llvm::ConstantPoolSDNode::getTargetFlags(), llvm::TargetIndexSDNode::getTargetFlags(), llvm::BlockAddressSDNode::getTargetFlags(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::ISD::GlobalAddress, llvm::ISD::GlobalTLSAddress, i, llvm::ConstantPoolSDNode::isMachineConstantPoolEntry(), llvm::ConstantSDNode::isOpaque(), llvm::SDNode::isTargetMemoryOpcode(), llvm::ISD::JumpTable, llvm::ARM_MB::LD, llvm_unreachable, llvm::ISD::LOAD, llvm::ISD::MCSymbol, N, llvm::ISD::PREFETCH, llvm::ISD::Register, llvm::ISD::RegisterMask, llvm::ISD::SRCVALUE, llvm::ARM_MB::ST, llvm::ISD::STORE, llvm::ISD::TargetBlockAddress, llvm::ISD::TargetConstant, llvm::ISD::TargetConstantFP, llvm::ISD::TargetConstantPool, llvm::ISD::TargetExternalSymbol, llvm::ISD::TargetFrameIndex, llvm::ISD::TargetGlobalAddress, llvm::ISD::TargetGlobalTLSAddress, llvm::ISD::TargetIndex, llvm::ISD::TargetJumpTable, and llvm::ISD::VECTOR_SHUFFLE.
Referenced by AddNodeIDNode().
|
static |
Definition at line 371 of file SelectionDAG.cpp.
References AddNodeIDOpcode(), AddNodeIDOperands(), and AddNodeIDValueTypes().
Referenced by llvm::SelectionDAG::getAddrSpaceCast(), llvm::SelectionDAG::getAtomic(), llvm::SelectionDAG::getBasicBlock(), llvm::SelectionDAG::getBlockAddress(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getConstantFP(), llvm::SelectionDAG::getConstantPool(), llvm::SelectionDAG::getEHLabel(), llvm::SelectionDAG::getFrameIndex(), llvm::SelectionDAG::getGlobalAddress(), llvm::SelectionDAG::getIndexedStore(), llvm::SelectionDAG::getJumpTable(), llvm::SelectionDAG::getLoad(), llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getMaskedGather(), llvm::SelectionDAG::getMaskedLoad(), llvm::SelectionDAG::getMaskedScatter(), llvm::SelectionDAG::getMaskedStore(), llvm::SelectionDAG::getMDNode(), llvm::SelectionDAG::getMemIntrinsicNode(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNodeIfExists(), llvm::SelectionDAG::getRegister(), llvm::SelectionDAG::getRegisterMask(), llvm::SelectionDAG::getSrcValue(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTargetIndex(), llvm::SelectionDAG::getTruncStore(), llvm::SelectionDAG::getVectorShuffle(), llvm::SelectionDAG::MorphNodeTo(), and llvm::SDNode::Profile().
|
static |
AddNodeIDNode - Generic routine for adding a nodes info to the NodeID data.
Definition at line 512 of file SelectionDAG.cpp.
References AddNodeIDCustom(), AddNodeIDOpcode(), AddNodeIDOperands(), AddNodeIDValueTypes(), llvm::SDNode::getOpcode(), llvm::SDNode::getVTList(), and llvm::SDNode::ops().
|
static |
AddNodeIDOpcode - Add the node opcode to the NodeID data.
Definition at line 341 of file SelectionDAG.cpp.
References llvm::FoldingSetNodeID::AddInteger().
Referenced by AddNodeIDNode().
|
static |
AddNodeIDOperands - Various routines for adding operands to the NodeID data.
Definition at line 353 of file SelectionDAG.cpp.
References llvm::FoldingSetNodeID::AddInteger(), and llvm::FoldingSetNodeID::AddPointer().
Referenced by AddNodeIDNode().
|
static |
AddNodeIDOperands - Various routines for adding operands to the NodeID data.
Definition at line 363 of file SelectionDAG.cpp.
References llvm::FoldingSetNodeID::AddInteger(), and llvm::FoldingSetNodeID::AddPointer().
|
static |
AddNodeIDValueTypes - Value type lists are intern'd so we can represent them solely with their pointer.
Definition at line 347 of file SelectionDAG.cpp.
References llvm::FoldingSetNodeID::AddPointer(), and llvm::SDVTList::VTs.
Referenced by AddNodeIDNode().
|
static |
Definition at line 4875 of file SelectionDAG.cpp.
References llvm::TargetLoweringBase::isNoopAddrSpaceCast(), and llvm::report_fatal_error().
Referenced by llvm::SelectionDAG::getMemcpy(), llvm::SelectionDAG::getMemmove(), and llvm::SelectionDAG::getMemset().
|
static |
Definition at line 7524 of file SelectionDAG.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dbgs(), llvm::SDNode::dumprFull(), llvm::SmallPtrSetImpl< PtrType >::erase(), llvm::errs(), llvm::SDValue::getNode(), llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::SDNode::op_values().
Referenced by llvm::checkForCycles().
|
static |
Swaps the values of N1 and N2.
Swaps all indices in the shuffle mask M that point at N1 to point at N2 and indices that point at N2 to point at N1.
Definition at line 1449 of file SelectionDAG.cpp.
References llvm::ShuffleVectorSDNode::commuteMask(), and std::swap().
Referenced by llvm::SelectionDAG::getVectorShuffle().
doNotCSE - Return true if CSE should not be performed for this node.
Definition at line 528 of file SelectionDAG.cpp.
References llvm::ISD::EH_LABEL, llvm::SDNode::getNumValues(), llvm::SDNode::getOpcode(), llvm::SDNode::getValueType(), llvm::MVT::Glue, llvm::ISD::HANDLENODE, and i.
|
static |
Determines the optimal series of memory ops to replace the memset / memcpy.
Return true if the number of memory ops is below the threshold (Limit). It returns the types of the sequence of memory ops to perform memset / memcpy by reference.
Definition at line 4465 of file SelectionDAG.cpp.
References llvm::TargetLoweringBase::allowsMisalignedMemoryAccesses(), assert(), llvm::EVT::bitsGT(), llvm::MVT::f64, llvm::CallingConv::Fast, llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getMachineFunction(), llvm::TargetLoweringBase::getOptimalMemOpType(), llvm::DataLayout::getPointerPrefAlignment(), llvm::TargetLoweringBase::getPointerTy(), llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, llvm::MVT::i8, llvm::EVT::isFloatingPoint(), llvm::MVT::isInteger(), llvm::TargetLoweringBase::isOperationLegalOrCustom(), llvm::TargetLoweringBase::isSafeMemOpType(), llvm::TargetLoweringBase::isTypeLegal(), llvm::EVT::isVector(), llvm::MVT::Other, llvm::MVT::SimpleTy, and llvm::ISD::STORE.
Referenced by getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), and getMemsetStores().
|
static |
Definition at line 3106 of file SelectionDAG.cpp.
References llvm::all_of(), llvm::SmallVectorImpl< T >::append(), assert(), llvm::EVT::bitsGT(), llvm::EVT::bitsLT(), llvm::ISD::BUILD_VECTOR, llvm::ArrayRef< T >::empty(), llvm::SelectionDAG::getBuildVector(), llvm::SDValue::getOpcode(), llvm::EVT::getScalarType(), llvm::SelectionDAG::getSExtOrTrunc(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValueType(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getZExtOrTrunc(), llvm::SDValue::isUndef(), llvm::TargetLoweringBase::isZExtFree(), llvm::SDNode::op_begin(), llvm::SDNode::op_end(), and llvm::ArrayRef< T >::size().
Referenced by llvm::SelectionDAG::getNode().
|
static |
Definition at line 3501 of file SelectionDAG.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, llvm::APInt::ashr(), llvm::APInt::lshr(), llvm::ISD::MUL, llvm::ISD::OR, llvm::ISD::ROTL, llvm::APInt::rotl(), llvm::ISD::ROTR, llvm::APInt::rotr(), llvm::ISD::SDIV, llvm::APInt::sdiv(), llvm::APInt::sge(), llvm::ISD::SHL, llvm::APInt::sle(), llvm::ISD::SMAX, llvm::ISD::SMIN, llvm::ISD::SRA, llvm::ISD::SREM, llvm::APInt::srem(), llvm::ISD::SRL, llvm::ISD::SUB, llvm::ISD::UDIV, llvm::APInt::udiv(), llvm::APInt::uge(), llvm::APInt::ule(), llvm::ISD::UMAX, llvm::ISD::UMIN, llvm::ISD::UREM, llvm::APInt::urem(), and llvm::ISD::XOR.
Referenced by llvm::SelectionDAG::FoldConstantArithmetic().
|
static |
Definition at line 4575 of file SelectionDAG.cpp.
References assert(), llvm::EVT::bitsGE(), llvm::dyn_cast(), llvm::StringRef::empty(), llvm::DataLayout::exceedsNaturalStackAlignment(), llvm::ISD::EXTLOAD, FindOptimalMemOpLowering(), llvm::DataLayout::getABITypeAlignment(), llvm::MachinePointerInfo::getAddrSpace(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getExtLoad(), llvm::MachineFunction::getFrameInfo(), llvm::FrameIndexSDNode::getIndex(), llvm::SelectionDAG::getMachineFunction(), llvm::TargetLoweringBase::getMaxStoresPerMemcpy(), llvm::SelectionDAG::getMemBasePlusOffset(), getMemsetStringVal(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::MachineFrameInfo::getObjectAlignment(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getStore(), llvm::MachineFunction::getSubtarget(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SelectionDAG::getTruncStore(), llvm::TargetLoweringBase::getTypeToTransformTo(), llvm::MachinePointerInfo::getWithOffset(), i, llvm::SelectionDAG::InferPtrAlignment(), llvm::MachineFrameInfo::isFixedObjectIndex(), llvm::EVT::isInteger(), isMemSrcFromString(), llvm::SDValue::isUndef(), llvm::EVT::isVector(), llvm::MinAlign(), llvm::MachineMemOperand::MONone, llvm::MachineMemOperand::MOVolatile, llvm::TargetRegisterInfo::needsStackRealignment(), llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MachineFrameInfo::setObjectAlignment(), shouldLowerMemFuncForSize(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::SPII::Store, llvm::StringRef::substr(), and llvm::ISD::TokenFactor.
Referenced by llvm::SelectionDAG::getMemcpy().
|
static |
Definition at line 4693 of file SelectionDAG.cpp.
References llvm::SmallVectorImpl< T >::clear(), llvm::dyn_cast(), FindOptimalMemOpLowering(), llvm::DataLayout::getABITypeAlignment(), llvm::MachinePointerInfo::getAddrSpace(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::MachineFunction::getFrameInfo(), llvm::FrameIndexSDNode::getIndex(), llvm::SelectionDAG::getLoad(), llvm::SelectionDAG::getMachineFunction(), llvm::TargetLoweringBase::getMaxStoresPerMemmove(), llvm::SelectionDAG::getMemBasePlusOffset(), llvm::SelectionDAG::getNode(), llvm::MachineFrameInfo::getObjectAlignment(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValue(), llvm::MachinePointerInfo::getWithOffset(), i, llvm::SelectionDAG::InferPtrAlignment(), llvm::MachineFrameInfo::isFixedObjectIndex(), llvm::SDValue::isUndef(), llvm::MachineMemOperand::MONone, llvm::MachineMemOperand::MOVolatile, llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MachineFrameInfo::setObjectAlignment(), shouldLowerMemFuncForSize(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::SPII::Store, and llvm::ISD::TokenFactor.
Referenced by llvm::SelectionDAG::getMemmove().
|
static |
Lower the call to 'memset' intrinsic function into a series of store operations.
| DAG | Selection DAG where lowered code is placed. |
| dl | Link to corresponding IR location. |
| Chain | Control flow dependency. |
| Dst | Pointer to destination memory location. |
| Src | Value of byte to write into the memory. |
| Size | Number of bytes to write. |
| Align | Alignment of the destination in bytes. |
| isVol | True if destination is volatile. |
| DstPtrInfo | IR information on the memory pointer. |
The function tries to replace 'llvm.memset' intrinsic with several store operations and value calculation code. This is usually profitable for small memory size.
Definition at line 4792 of file SelectionDAG.cpp.
References assert(), llvm::EVT::bitsLT(), llvm::dyn_cast(), FindOptimalMemOpLowering(), llvm::MachinePointerInfo::getAddrSpace(), llvm::MachineFunction::getFrameInfo(), llvm::FrameIndexSDNode::getIndex(), llvm::SelectionDAG::getMachineFunction(), llvm::TargetLoweringBase::getMaxStoresPerMemset(), getMemsetValue(), llvm::SDValue::getNode(), llvm::MachineFrameInfo::getObjectAlignment(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValueType(), llvm::MachinePointerInfo::getWithOffset(), i, llvm::MachineFrameInfo::isFixedObjectIndex(), llvm::TargetLoweringBase::isTruncateFree(), llvm::SDValue::isUndef(), llvm::EVT::isVector(), llvm::MachineMemOperand::MONone, llvm::MachineMemOperand::MOVolatile, llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MachineFrameInfo::setObjectAlignment(), shouldLowerMemFuncForSize(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::SPII::Store, llvm::ISD::TokenFactor, and llvm::ISD::TRUNCATE.
Referenced by llvm::SelectionDAG::getMemset().
|
static |
getMemsetStringVal - Similar to getMemsetValue.
Except this is only used when a memcpy is turned into a memset when the source is a constant string ptr.
Definition at line 4394 of file SelectionDAG.cpp.
References assert(), llvm::ISD::BITCAST, llvm::StringRef::empty(), llvm::MVT::f128, llvm::MVT::f32, llvm::MVT::f64, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getConstantFP(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getNode(), llvm::EVT::getSizeInBits(), llvm::EVT::getTypeForEVT(), llvm::EVT::getVectorElementType(), llvm::EVT::getVectorNumElements(), llvm::EVT::getVectorVT(), i, llvm::MVT::i32, llvm::MVT::i64, llvm::EVT::isInteger(), llvm::DataLayout::isLittleEndian(), llvm::EVT::isVector(), llvm_unreachable, fuzzer::min(), llvm::TargetLoweringBase::shouldConvertConstantLoadToIntImm(), and llvm::StringRef::size().
Referenced by getMemcpyLoadsAndStores().
|
static |
getMemsetValue - Vectorized representation of the memset value operand.
Definition at line 4355 of file SelectionDAG.cpp.
References llvm::lltok::APFloat, assert(), C, llvm::SelectionDAG::EVTToAPFloatSemantics(), llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getConstantFP(), llvm::SelectionDAG::getContext(), llvm::EVT::getIntegerVT(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarSizeInBits(), llvm::EVT::getScalarType(), llvm::APInt::getSplat(), llvm::SelectionDAG::getSplatBuildVector(), llvm::SDValue::getValueType(), llvm::MVT::i8, llvm::EVT::isInteger(), llvm::SDValue::isUndef(), Magic, llvm::ISD::MUL, and llvm::ISD::ZERO_EXTEND.
Referenced by getMemsetStores().
If a SHL/SRA/SRL node has a constant or splat constant shift amount that is less than the element bit-width of the shift node, return it.
Definition at line 1971 of file SelectionDAG.cpp.
References llvm::SDValue::getOperand(), llvm::SDValue::getScalarValueSizeInBits(), llvm::isConstOrConstSplat(), and llvm::APInt::ult().
Referenced by llvm::SelectionDAG::computeKnownBits().
|
static |
InferPointerInfo - If the specified ptr/offset is a frame index, infer a MachinePointerInfo record from it.
This is particularly useful because the code generator has many cases where it doesn't bother passing in a MachinePointerInfo to getLoad or getStore when it has "FI+Cst".
Definition at line 5283 of file SelectionDAG.cpp.
References llvm::ISD::ADD, llvm::MachinePointerInfo::getFixedStack(), llvm::SelectionDAG::getMachineFunction(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), and Offset.
Referenced by llvm::SelectionDAG::getLoad(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTruncStore(), and InferPointerInfo().
|
static |
InferPointerInfo - If the specified ptr/offset is a frame index, infer a MachinePointerInfo record from it.
This is particularly useful because the code generator has many cases where it doesn't bother passing in a MachinePointerInfo to getLoad or getStore when it has "FI+Cst".
Definition at line 5306 of file SelectionDAG.cpp.
References InferPointerInfo(), and llvm::SDValue::isUndef().
isMemSrcFromString - Returns true if memcpy source is a string constant.
Definition at line 4443 of file SelectionDAG.cpp.
References llvm::ISD::ADD, llvm::ISD::Constant, G, llvm::getConstantStringInfo(), llvm::GlobalAddressSDNode::getGlobal(), llvm::GlobalAddressSDNode::getOffset(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), and llvm::ISD::GlobalAddress.
Referenced by getMemcpyLoadsAndStores().
|
static |
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 275 of file SelectionDAG.cpp.
References llvm_unreachable, 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().
makeVTList - Return an instance of the SDVTList struct initialized with the specified members.
Definition at line 58 of file SelectionDAG.cpp.
Referenced by llvm::SelectionDAG::getVTList().
|
static |
Definition at line 4567 of file SelectionDAG.cpp.
References llvm::MachineFunction::getFunction(), llvm::MachineFunction::getTarget(), llvm::TargetMachine::getTargetTriple(), llvm::Triple::isOSDarwin(), llvm::Function::optForMinSize(), and llvm::Function::optForSize().
Referenced by getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), and getMemsetStores().
|
static |
VerifySDNode - Sanity check the given SDNode. Aborts if it is invalid.
Definition at line 655 of file SelectionDAG.cpp.
References assert(), llvm::ISD::BUILD_PAIR, llvm::ISD::BUILD_VECTOR, E, llvm::SDNode::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::EVT::getSizeInBits(), llvm::SDValue::getValueSizeInBits(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorElementType(), llvm::EVT::getVectorNumElements(), I, llvm::EVT::isFloatingPoint(), llvm::EVT::isInteger(), llvm::EVT::isVector(), llvm::SDNode::op_begin(), and llvm::SDNode::op_end().
|
static |
Definition at line 6987 of file SelectionDAG.cpp.
|
static |
Definition at line 6988 of file SelectionDAG.cpp.
|
static |
Definition at line 6989 of file SelectionDAG.cpp.
1.8.6