19 #define DEBUG_TYPE "systemz-selectiondag-info"
51 SDValue Size,
unsigned Align,
bool IsVolatile,
bool AlwaysInline,
56 if (
auto *CSize = dyn_cast<ConstantSDNode>(Size))
58 Chain, Dst, Src, CSize->getZExtValue());
66 SDValue Dst, uint64_t ByteVal, uint64_t Size,
68 uint64_t StoreVal = ByteVal;
69 for (
unsigned I = 1;
I < Size; ++
I)
70 StoreVal |= ByteVal << (
I * 8);
73 Dst, DstPtrInfo, Align);
85 if (
auto *CSize = dyn_cast<ConstantSDNode>(Size)) {
86 uint64_t Bytes = CSize->getZExtValue();
89 if (
auto *CByte = dyn_cast<ConstantSDNode>(Byte)) {
94 uint64_t ByteVal = CByte->getZExtValue();
95 if (ByteVal == 0 || ByteVal == 255 ?
98 unsigned Size1 = Bytes == 16 ? 8 : 1 <<
findLastSet(Bytes);
99 unsigned Size2 = Bytes - Size1;
108 std::min(Align, Size1), DstPtrInfo);
114 SDValue Chain1 = DAG.
getStore(Chain, DL, Byte, Dst, DstPtrInfo, Align);
125 assert(Bytes >= 2 &&
"Should have dealt with 0- and 1-byte cases already");
129 if (CByte && CByte->getZExtValue() == 0)
131 Chain, Dst, Dst, Bytes);
135 Chain = DAG.
getStore(Chain, DL, Byte, Dst, DstPtrInfo, Align);
139 Chain, DstPlus1, Dst, Bytes - 1);
184 if (
auto *CSize = dyn_cast<ConstantSDNode>(Size)) {
185 uint64_t Bytes = CSize->getZExtValue();
186 assert(Bytes > 0 &&
"Caller should have handled 0-size case");
187 Chain =
emitCLC(DAG, DL, Chain, Src1, Src2, Bytes);
218 return std::make_pair(End, Chain);
224 bool isStpcpy)
const {
228 return std::make_pair(isStpcpy ? EndDest : Dest, EndDest.
getValue(1));
258 return std::make_pair(Len, Chain);
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
static MVT getIntegerVT(unsigned BitWidth)
static std::pair< SDValue, SDValue > getBoundedStrlen(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src, SDValue Limit)
SDValue getValue(unsigned R) const
T findLastSet(T Val, ZeroBehavior ZB=ZB_Max)
Get the index of the last set bit starting from the least significant bit.
static SDValue memsetStore(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dst, uint64_t ByteVal, uint64_t Size, unsigned Align, MachinePointerInfo DstPtrInfo)
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
MachinePointerInfo getWithOffset(int64_t O) const
std::pair< SDValue, SDValue > EmitTargetCodeForMemchr(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src, SDValue Char, SDValue Length, MachinePointerInfo SrcPtrInfo) const override
Emit target-specific code that performs a memchr, in cases where that is faster than a libcall...
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dst, SDValue Byte, SDValue Size, unsigned Align, bool IsVolatile, MachinePointerInfo DstPtrInfo) const override
Emit target-specific code that performs a memset.
Simple integer binary arithmetic operators.
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with etc Experimental Use value profile to guide fuzzing Number of simultaneous worker processes to run the jobs If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
static SDValue emitCLC(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src1, SDValue Src2, uint64_t Size)
static SDValue addIPMSequence(const SDLoc &DL, SDValue Glue, SelectionDAG &DAG)
static const unsigned End
std::pair< SDValue, SDValue > EmitTargetCodeForMemcmp(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src1, SDValue Src2, SDValue Size, MachinePointerInfo Op1PtrInfo, MachinePointerInfo Op2PtrInfo) const override
Emit target-specific code that performs a memcmp, in cases where that is faster than a libcall...
SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool IsVolatile, bool AlwaysInline, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const override
Emit target-specific code that performs a memcpy.
EVT - Extended Value Type.
This class contains a discriminated union of information about pointers in memory operands...
const unsigned CCMASK_SRST_FOUND
TokenFactor - This node takes multiple tokens as input and produces a single token result...
unsigned countPopulation(T Value)
Count the number of set bits in a value.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either zero-extending or trunca...
std::pair< SDValue, SDValue > EmitTargetCodeForStrcmp(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src1, SDValue Src2, MachinePointerInfo Op1PtrInfo, MachinePointerInfo Op2PtrInfo) const override
Emit target-specific code that performs a strcmp, in cases where that is faster than a libcall...
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
const unsigned CCMASK_SRST
Bitwise operators - logical and, logical or, logical xor.
Represents a single loop in the control flow graph.
Sequence
A sequence of states that a pointer may go through in which an objc_retain and objc_release are actua...
static SDValue emitMemMem(SelectionDAG &DAG, const SDLoc &DL, unsigned Sequence, unsigned Loop, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size)
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
std::pair< SDValue, SDValue > EmitTargetCodeForStrnlen(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src, SDValue MaxLength, MachinePointerInfo SrcPtrInfo) const override
EVT getValueType() const
Return the ValueType of the referenced return value.
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::pair< SDValue, SDValue > EmitTargetCodeForStrcpy(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dest, SDValue Src, MachinePointerInfo DestPtrInfo, MachinePointerInfo SrcPtrInfo, bool isStpcpy) const override
Emit target-specific code that performs a strcpy or stpcpy, in cases where that is faster than a libc...
std::pair< SDValue, SDValue > EmitTargetCodeForStrlen(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src, MachinePointerInfo SrcPtrInfo) const override
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...