25 #define DEBUG_TYPE "x86-selectiondag-info"
27 bool X86SelectionDAGInfo::isBaseRegConflictPossible(
41 for (
unsigned R : ClobberSet)
60 const unsigned ClobberSet[] = {X86::RCX, X86::RAX, X86::RDI,
61 X86::ECX, X86::EAX, X86::EDI};
62 assert(!isBaseRegConflictPossible(DAG, ClobberSet));
72 if ((Align & 3) != 0 || !ConstantSize ||
73 ConstantSize->
getZExtValue() > Subtarget.getMaxInlineSizeThreshold()) {
77 if (
const char *bzeroEntry = V &&
78 V->
isNullValue() ? Subtarget.getBZeroEntry() :
nullptr) {
86 Args.push_back(Entry);
88 Args.push_back(Entry);
98 return CallResult.second;
110 unsigned BytesLeft = 0;
111 bool TwoRepStos =
false;
121 Val = (Val << 8) | Val;
126 Val = (Val << 8) | Val;
127 Val = (Val << 16) | Val;
128 if (Subtarget.is64Bit() && ((Align & 0x7) == 0)) {
131 Val = (Val << 32) | Val;
144 BytesLeft = SizeVal % UBytes;
153 Chain = DAG.
getCopyToReg(Chain, dl, X86::AL, Src, InFlag);
157 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RCX : X86::ECX,
160 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RDI : X86::EDI,
171 EVT CVT = Count.getValueType();
182 }
else if (BytesLeft) {
184 unsigned Offset = SizeVal - BytesLeft;
185 EVT AddrVT = Dst.getValueType();
213 if (!AlwaysInline && SizeVal > Subtarget.getMaxInlineSizeThreshold())
220 if (!AlwaysInline && (Align & 3) != 0)
229 const unsigned ClobberSet[] = {X86::RCX, X86::RSI, X86::RDI,
230 X86::ECX, X86::ESI, X86::EDI};
231 if (isBaseRegConflictPossible(DAG, ClobberSet))
247 unsigned CountVal = SizeVal / UBytes;
249 unsigned BytesLeft = SizeVal % UBytes;
252 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RCX :
256 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RDI :
260 Chain = DAG.
getCopyToReg(Chain, dl, Subtarget.is64Bit() ? X86::RSI :
273 unsigned Offset = SizeVal - BytesLeft;
274 EVT DstVT = Dst.getValueType();
275 EVT SrcVT = Src.getValueType();
void push_back(const T &Elt)
CallLoweringInfo & setCallee(CallingConv::ID CC, Type *ResultType, SDValue Target, ArgListTy &&ArgsList, unsigned FixedArgs=-1)
SDValue getValue(unsigned R) const
Repeat move, corresponds to X86::REP_MOVSx.
LLVMContext * getContext() const
SDValue getCopyToReg(SDValue Chain, SDLoc dl, unsigned Reg, SDValue N)
CallLoweringInfo & setDebugLoc(SDLoc dl)
const TargetSubtargetInfo & getSubtarget() const
unsigned getSizeInBits() const
SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVolatile, bool AlwaysInline, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const override
EmitTargetCodeForMemcpy - Emit target-specific code that performs a memcpy.
SDValue getExternalSymbol(const char *Sym, EVT VT)
SDValue getMemcpy(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool AlwaysInline, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
SDValue getMemset(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool isTailCall, MachinePointerInfo DstPtrInfo)
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 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...
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.
MachinePointerInfo - This class contains a discriminated union of information about pointers in memor...
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...
SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVolatile, MachinePointerInfo DstPtrInfo) const override
EmitTargetCodeForMemset - Emit target-specific code that performs a memset.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
unsigned getAddrSpace() const
getAddrSpace - Return the LLVM IR address space number that this pointer points into.
MachineFrameInfo * getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
Bitwise operators - logical and, logical or, logical xor.
unsigned getSizeInBits() const
getSizeInBits - Return the size of the specified value type in bits.
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, SDLoc DL, EVT VT, bool isTarget=false, bool isOpaque=false)
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 getValueType(EVT)
const TargetLowering & getTargetLoweringInfo() const
bool hasOpaqueSPAdjustment() const
Returns true if the function contains opaque dynamic stack adjustments.
C - The default llvm calling convention, compatible with C.
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 getIntPtrConstant(uint64_t Val, SDLoc DL, bool isTarget=false)
This file describes how to lower LLVM code to machine code.
uint64_t getZExtValue() const