25 #define DEBUG_TYPE "x86-selectiondag-info"
27 bool X86SelectionDAGInfo::isBaseRegConflictPossible(
41 for (
unsigned R : ClobberSet)
57 const MCPhysReg ClobberSet[] = {X86::RCX, X86::RAX, X86::RDI,
58 X86::ECX, X86::EAX, X86::EDI};
59 assert(!isBaseRegConflictPossible(DAG, ClobberSet));
69 if ((Align & 3) != 0 || !ConstantSize ||
70 ConstantSize->
getZExtValue() > Subtarget.getMaxInlineSizeThreshold()) {
74 if (
const char *bzeroEntry = V &&
75 V->
isNullValue() ? Subtarget.getBZeroEntry() :
nullptr) {
83 Args.push_back(Entry);
85 Args.push_back(Entry);
93 std::pair<SDValue,SDValue> CallResult = TLI.
LowerCallTo(CLI);
94 return CallResult.second;
106 unsigned BytesLeft = 0;
107 bool TwoRepStos =
false;
117 Val = (Val << 8) | Val;
122 Val = (Val << 8) | Val;
123 Val = (Val << 16) | Val;
124 if (Subtarget.is64Bit() && ((Align & 0x7) == 0)) {
127 Val = (Val << 32) | Val;
140 BytesLeft = SizeVal % UBytes;
149 Chain = DAG.
getCopyToReg(Chain, dl, X86::AL, Src, InFlag);
153 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RCX : X86::ECX,
156 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RDI : X86::EDI,
167 EVT CVT = Count.getValueType();
177 }
else if (BytesLeft) {
179 unsigned Offset = SizeVal - BytesLeft;
180 EVT AddrVT = Dst.getValueType();
208 if (!AlwaysInline && SizeVal > Subtarget.getMaxInlineSizeThreshold())
215 if (!AlwaysInline && (Align & 3) != 0)
224 const MCPhysReg ClobberSet[] = {X86::RCX, X86::RSI, X86::RDI,
225 X86::ECX, X86::ESI, X86::EDI};
226 if (isBaseRegConflictPossible(DAG, ClobberSet))
242 unsigned CountVal = SizeVal / UBytes;
244 unsigned BytesLeft = SizeVal % UBytes;
247 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RCX : X86::ECX,
250 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RDI : X86::EDI,
253 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RSI : X86::ESI,
265 unsigned Offset = SizeVal - BytesLeft;
266 EVT DstVT = Dst.getValueType();
267 EVT SrcVT = Src.getValueType();
void push_back(const T &Elt)
SDValue getValue(unsigned R) const
Repeat move, corresponds to X86::REP_MOVSx.
LLVMContext * getContext() const
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.
const TargetSubtargetInfo & getSubtarget() const
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
Function Alias Analysis Results
unsigned getSizeInBits() const
CallLoweringInfo & setDebugLoc(const SDLoc &dl)
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
SDValue getExternalSymbol(const char *Sym, EVT VT)
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFunction & getMachineFunction() const
CallLoweringInfo & setChain(SDValue InChain)
MachinePointerInfo getWithOffset(int64_t O) const
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
Simple integer binary arithmetic operators.
const DataLayout & getDataLayout() const
MVT - Machine Value Type.
The instances of the Type class are immutable: once they are created, they are never changed...
C - The default llvm calling convention, compatible with C.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Repeat fill, corresponds to X86::REP_STOSx.
static Type * getVoidTy(LLVMContext &C)
EVT - Extended Value Type.
std::vector< ArgListEntry > ArgListTy
This structure contains all information that is necessary for lowering calls.
This class contains a discriminated union of information about pointers in memory operands...
unsigned getBaseRegister() const
bool bitsGT(EVT VT) const
bitsGT - Return true if this has more bits than VT.
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
TokenFactor - This node takes multiple tokens as input and produces a single token result...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
CallLoweringInfo & setCallee(CallingConv::ID CC, Type *ResultType, SDValue Target, ArgListTy &&ArgsList)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
SDValue getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool AlwaysInline, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
unsigned getAddrSpace() const
Return the LLVM IR address space number that this pointer points into.
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
Bitwise operators - logical and, logical or, logical xor.
unsigned getSizeInBits() const
getSizeInBits - Return the size of the specified value type in bits.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
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())
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVolatile, MachinePointerInfo DstPtrInfo) const override
Emit target-specific code that performs a memset.
SDValue getValueType(EVT)
const TargetLowering & getTargetLoweringInfo() const
bool hasOpaqueSPAdjustment() const
Returns true if the function contains opaque dynamic stack adjustments.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
static bool isVolatile(Instruction *Inst)
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
SDValue getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool isTailCall, MachinePointerInfo DstPtrInfo)
This file describes how to lower LLVM code to machine code.
uint64_t getZExtValue() const