17#define GET_SDNODE_DESC
18#include "SystemZGenSDNodeInfo.inc"
22#define DEBUG_TYPE "systemz-selectiondag-info"
30 return "SystemZISD::GET_CCMASK";
37 return Op == SystemZISD::MEMSET_MVC ? 2 : 1;
46 if (
Op == SystemZISD::MEMSET_MVC)
47 Ops = { Chain, Dst, LenAdj, Byte };
49 Ops = { Chain, Dst, Src, LenAdj };
61 assert(
Size >= Adj &&
"Adjusted length overflow.");
87 CSize->getZExtValue());
105 if (
Subtarget.hasMiscellaneousExtensions3() && CSize->getZExtValue() > 0 &&
106 CSize->getZExtValue() <= 256) {
108 return DAG.
getNode(SystemZISD::MEMMOVE,
DL, MVT::Other,
109 {Chain, Dst, Src, Size64});
122 for (
unsigned I = 1;
I <
Size; ++
I)
123 StoreVal |= ByteVal << (
I * 8);
126 Dst, DstPtrInfo, Alignment);
134 EVT PtrVT = Dst.getValueType();
141 uint64_t Bytes = CSize->getZExtValue();
149 uint64_t ByteVal = CByte->getZExtValue();
150 if (ByteVal == 0 || ByteVal == 255
154 unsigned Size2 = Bytes - Size1;
156 Alignment, DstPtrInfo);
164 std::min(Alignment,
Align(Size1)), DstPtrInfo);
171 DAG.
getStore(Chain,
DL, Byte, Dst, DstPtrInfo, Alignment);
181 assert(Bytes >= 2 &&
"Should have dealt with 0- and 1-byte cases already");
184 if (CByte && CByte->getZExtValue() == 0)
192 if (CByte && CByte->getZExtValue() == 0)
220 uint64_t Bytes = CSize->getZExtValue();
221 assert(Bytes > 0 &&
"Caller should have handled 0-size case");
222 CCReg =
emitMemMemImm(DAG,
DL, SystemZISD::CLC, Chain, Src2, Src1, Bytes);
233 EVT PtrVT = Src.getValueType();
243 Chain =
End.getValue(2);
252 return std::make_pair(
End, Chain);
258 bool isStpcpy,
const CallInst *CI)
const {
260 SDValue EndDest = DAG.
getNode(SystemZISD::STPCPY,
DL, VTs, Chain, Dest, Src,
262 return std::make_pair(isStpcpy ? EndDest : Dest, EndDest.
getValue(1));
271 SDValue Unused = DAG.
getNode(SystemZISD::STRCMP,
DL, VTs, Chain, Src2, Src1,
273 SDValue CCReg = Unused.getValue(1);
274 Chain = Unused.getValue(2);
287 EVT PtrVT = Src.getValueType();
291 Chain =
End.getValue(2);
293 return std::make_pair(Len, Chain);
299 EVT PtrVT = Src.getValueType();
306 EVT PtrVT = Src.getValueType();
const AArch64Subtarget & Subtarget
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static SDValue emitMemMemReg(SelectionDAG &DAG, const SDLoc &DL, unsigned Op, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, SDValue Byte=SDValue())
static std::pair< SDValue, SDValue > getBoundedStrlen(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src, SDValue Limit)
static unsigned getMemMemLenAdj(unsigned Op)
static SDValue addIPMSequence(const SDLoc &DL, SDValue CCReg, SelectionDAG &DAG)
static SDValue memsetStore(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dst, uint64_t ByteVal, uint64_t Size, Align Alignment, MachinePointerInfo DstPtrInfo)
static SDValue createMemMemNode(SelectionDAG &DAG, const SDLoc &DL, unsigned Op, SDValue Chain, SDValue Dst, SDValue Src, SDValue LenAdj, SDValue Byte)
static SDValue emitMemMemImm(SelectionDAG &DAG, const SDLoc &DL, unsigned Op, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, SDValue Byte=SDValue())
This class represents a function call, abstracting a target machine's calling convention.
static MVT getIntegerVT(unsigned BitWidth)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDValue getValue(unsigned R) const
EVT getValueType() const
Return the ValueType of the referenced return value.
const char * getTargetNodeName(unsigned Opcode) const override
Returns the name of the given target-specific opcode, suitable for debug printing.
SelectionDAGGenTargetInfo(const SDNodeInfo &GenNodeInfo)
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
LLVM_ABI SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
LLVM_ABI SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, Align Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const MMOMetadata &Metadata=MMOMetadata())
Helper function to build ISD::STORE nodes.
LLVM_ABI SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
LLVM_ABI SDValue getSignedConstant(int64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
LLVM_ABI SDValue getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either any-extending or truncat...
LLVM_ABI SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
MachineFunction & getMachineFunction() const
LLVM_ABI 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...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
const char * getTargetNodeName(unsigned Opcode) const override
Returns the name of the given target-specific opcode, suitable for debug printing.
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.
std::pair< SDValue, SDValue > EmitTargetCodeForMemcmp(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src1, SDValue Src2, SDValue Size, const CallInst *CI) const override
Emit target-specific code that performs a memcmp/bcmp, in cases where that is faster than a libcall.
SystemZSelectionDAGInfo()
SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, Align DstAlign, Align SrcAlign, bool IsVolatile, bool AlwaysInline, bool &IsTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const override
Emit target-specific code that performs a memcpy.
std::pair< SDValue, SDValue > EmitTargetCodeForStrnlen(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src, SDValue MaxLength, MachinePointerInfo SrcPtrInfo) const override
std::pair< SDValue, SDValue > EmitTargetCodeForStrlen(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src, const CallInst *CI) const override
std::pair< SDValue, SDValue > EmitTargetCodeForStrcpy(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dest, SDValue Src, MachinePointerInfo DestPtrInfo, MachinePointerInfo SrcPtrInfo, bool isStpcpy, const CallInst *CI) 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 > EmitTargetCodeForStrcmp(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Src1, SDValue Src2, MachinePointerInfo Op1PtrInfo, MachinePointerInfo Op2PtrInfo, const CallInst *CI) const override
Emit target-specific code that performs a strcmp, in cases where that is faster than a libcall.
SDValue EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, Align DstAlign, Align SrcAlign, bool IsVolatile, bool &IsTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const override
Emit target-specific code that performs a memmove.
SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Dst, SDValue Byte, SDValue Size, Align Alignment, bool IsVolatile, bool AlwaysInline, bool &IsTailCall, MachinePointerInfo DstPtrInfo) const override
Emit target-specific code that performs a memset.
@ ADD
Simple integer binary arithmetic operators.
@ SHL
Shift and rotation operations.
@ AND
Bitwise operators - logical and, logical or, logical xor.
@ TokenFactor
TokenFactor - This node takes multiple tokens as input and produces a single token result.
const unsigned CCMASK_SRST
const unsigned CCMASK_SRST_FOUND
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
constexpr int popcount(T Value) noexcept
Count the number of set bits in a value.
DWARFExpression::Operation Op
T bit_floor(T Value)
Returns the largest integral power of two no greater than Value if Value is nonzero.
@ End
Run the machine verifier once, at the end of the pipeline.
This struct is a compact representation of a valid (non-zero power of two) alignment.
This class contains a discriminated union of information about pointers in memory operands,...
MachinePointerInfo getWithOffset(int64_t O) const
This represents a list of ValueType's that has been intern'd by a SelectionDAG.