25 #define DEBUG_TYPE "x86-selectiondag-info" 27 bool X86SelectionDAGInfo::isBaseRegConflictPossible(
41 for (
unsigned R : ClobberSet)
52 struct RepMovsRepeats {
53 RepMovsRepeats(uint64_t
Size) :
Size(Size) {}
55 uint64_t Count()
const {
return Size / UBytes(); }
56 uint64_t BytesLeft()
const {
return Size % UBytes(); }
57 uint64_t UBytes()
const {
return AVT.getSizeInBits() / 8; }
75 const MCPhysReg ClobberSet[] = {X86::RCX, X86::RAX, X86::RDI,
77 assert(!isBaseRegConflictPossible(DAG, ClobberSet));
87 if ((Align & 3) != 0 || !ConstantSize ||
88 ConstantSize->
getZExtValue() > Subtarget.getMaxInlineSizeThreshold()) {
92 if (
const char *bzeroName = (ValC && ValC->
isNullValue())
102 Args.push_back(Entry);
104 Args.push_back(Entry);
114 std::pair<SDValue,SDValue> CallResult = TLI.
LowerCallTo(CLI);
115 return CallResult.second;
127 unsigned BytesLeft = 0;
137 Val = (Val << 8) | Val;
142 Val = (Val << 8) | Val;
143 Val = (Val << 16) | Val;
144 if (Subtarget.is64Bit() && ((Align & 0x7) == 0)) {
147 Val = (Val << 32) | Val;
160 BytesLeft = SizeVal % UBytes;
173 bool Use64BitRegs = Subtarget.isTarget64BitLP64();
177 Chain = DAG.
getCopyToReg(Chain, dl, Use64BitRegs ? X86::RDI : X86::EDI,
187 unsigned Offset = SizeVal - BytesLeft;
216 if (!AlwaysInline && Repeats.Size > Subtarget.getMaxInlineSizeThreshold())
223 if (!AlwaysInline && (Align & 3) != 0)
232 const MCPhysReg ClobberSet[] = {X86::RCX, X86::RSI, X86::RDI,
234 if (isBaseRegConflictPossible(DAG, ClobberSet))
240 if (!Subtarget.hasERMSB() && !(Align & 1)) {
251 if (Repeats.BytesLeft() > 0 &&
259 bool Use64BitRegs = Subtarget.isTarget64BitLP64();
264 Chain = DAG.
getCopyToReg(Chain, dl, Use64BitRegs ? X86::RDI : X86::EDI,
277 if (Repeats.BytesLeft()) {
279 unsigned Offset = Repeats.Size - Repeats.BytesLeft();
292 Align, isVolatile, AlwaysInline,
false,
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
EVT getValueType() const
Return the ValueType of the referenced return value.
C - The default llvm calling convention, compatible with C.
Repeat move, corresponds to X86::REP_MOVSx.
This class represents lattice values for constants.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
void push_back(const T &Elt)
bool hasOpaqueSPAdjustment() const
Returns true if the function contains opaque dynamic stack adjustments.
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.
Function Alias Analysis Results
unsigned const TargetRegisterInfo * TRI
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)
unsigned getAddrSpace() const
Return the LLVM IR address space number that this pointer points into.
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
CallLoweringInfo & setChain(SDValue InChain)
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
const DataLayout & getDataLayout() const
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...
unsigned getBaseRegister() const
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
MachineFunction & getMachineFunction() const
Simple integer binary arithmetic operators.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
bool bitsGT(EVT VT) const
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...
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...
The instances of the Type class are immutable: once they are created, they are never changed...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Repeat fill, corresponds to X86::REP_STOSx.
static Type * getVoidTy(LLVMContext &C)
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...
TokenFactor - This node takes multiple tokens as input and produces a single token result...
const TargetLowering & getTargetLoweringInfo() const
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...
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...
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
MachinePointerInfo getWithOffset(int64_t O) const
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
const TargetSubtargetInfo & getSubtarget() const
bool optForMinSize() const
Optimize this function for minimum size (-Oz).
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
SDValue getValue(unsigned R) const
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())
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)
static bool isVolatile(Instruction *Inst)
uint64_t getZExtValue() const
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)
LLVMContext * getContext() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
CallLoweringInfo & setLibCallee(CallingConv::ID CC, Type *ResultType, SDValue Target, ArgListTy &&ArgsList)
This file describes how to lower LLVM code to machine code.
const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.