301 uint64_t ShiftAmount = cast<ConstantSDNode>(N->
getOperand(1))->getZExtValue();
324 while (ShiftAmount--) {
325 Victim = DAG.
getNode(Opc8, dl, VT, Victim);
334 "Invalid opcode for Div/Rem lowering");
344 LC = IsSigned ? RTLIB::SDIVREM_I8 : RTLIB::UDIVREM_I8;
347 LC = IsSigned ? RTLIB::SDIVREM_I16 : RTLIB::UDIVREM_I16;
350 LC = IsSigned ? RTLIB::SDIVREM_I32 : RTLIB::UDIVREM_I32;
353 LC = IsSigned ? RTLIB::SDIVREM_I64 : RTLIB::UDIVREM_I64;
356 LC = IsSigned ? RTLIB::SDIVREM_I128 : RTLIB::UDIVREM_I128;
369 Args.push_back(Entry);
387 return CallInfo.first;
394 const GlobalValue *GV = cast<GlobalAddressSDNode>(
Op)->getGlobal();
406 const BlockAddress *BA = cast<BlockAddressSDNode>(
Op)->getBlockAddress();
440 bool UseTest =
false;
453 switch (
C->getSExtValue()) {
486 switch (
C->getSExtValue()) {
620 SDValue Cmp = getAVRCmp(LHS, RHS, CC, TargetCC, DAG, dl);
635 SDValue Cmp = getAVRCmp(LHS, RHS, CC, TargetCC, DAG, dl);
638 SDValue Ops[] = {TrueV, FalseV, TargetCC, Cmp};
650 SDValue Cmp = getAVRCmp(LHS, RHS, CC, TargetCC, DAG, DL);
655 SDValue Ops[] = {TrueV, FalseV, TargetCC, Cmp};
684 return LowerShifts(Op, DAG);
686 return LowerGlobalAddress(Op, DAG);
688 return LowerBlockAddress(Op, DAG);
690 return LowerBR_CC(Op, DAG);
692 return LowerSELECT_CC(Op, DAG);
694 return LowerSETCC(Op, DAG);
696 return LowerVASTART(Op, DAG);
699 return LowerDivRem(Op, DAG);
718 DAG.
getConstant(-
C->getAPIntValue(), DL,
C->getValueType(0)));
773 VT =
LD->getMemoryVT();
774 Op =
LD->getBasePtr().getNode();
780 }
else if (
const StoreSDNode *
ST = dyn_cast<StoreSDNode>(N)) {
781 VT =
ST->getMemoryVT();
782 Op =
ST->getBasePtr().getNode();
799 int RHSC = RHS->getSExtValue();
829 VT =
LD->getMemoryVT();
832 }
else if (
const StoreSDNode *
ST = dyn_cast<StoreSDNode>(N)) {
833 VT =
ST->getMemoryVT();
850 int RHSC = RHS->getSExtValue();
876 #include "AVRGenCallingConv.inc" 883 if(
Arg.PartOffset > 0)
continue;
884 unsigned Bytes = ((
Arg.ArgVT.getSizeInBits()) + 7) / 8;
894 for (
unsigned i = 0, e = In.
size(); i != e;) {
897 while ((i != e) && (In[i].PartOffset ==
Offset)) {
898 Offset += In[i].VT.getStoreSize();
910 return G->getSymbol();
914 return G->getGlobal()->getName();
930 CCState &CCInfo,
bool IsCall,
bool IsVarArg) {
931 static const MCPhysReg RegList8[] = {AVR::R24, AVR::R22, AVR::R20,
932 AVR::R18, AVR::R16, AVR::R14,
933 AVR::R12, AVR::R10, AVR::R8};
934 static const MCPhysReg RegList16[] = {AVR::R25R24, AVR::R23R22, AVR::R21R20,
935 AVR::R19R18, AVR::R17R16, AVR::R15R14,
936 AVR::R13R12, AVR::R11R10, AVR::R9R8};
952 assert(F !=
nullptr &&
"function should not be null");
958 bool UsesStack =
false;
959 for (
unsigned i = 0, pos = 0, e = Args.
size(); i != e; ++i) {
960 unsigned Size = Args[i];
965 if (Size == 0)
continue;
967 MVT LocVT = (IsCall) ? (*Outs)[pos].VT : (*Ins)[pos].VT;
970 if (!UsesStack && (Size <= RegsLeft)) {
973 for (
unsigned j = 0; j !=
Size; ++j) {
987 for (
unsigned j = 0; j !=
Size; ++j) {
1006 CCState &CCInfo,
bool IsCall,
bool IsVarArg) {
1013 CallConv, ArgLocs, CCInfo,
1024 CCState &CCInfo,
bool IsCall,
bool IsVarArg) {
1028 CallConv, ArgLocs, CCInfo,
1034 CallConv, ArgLocs, CCInfo,
1041 SDValue AVRTargetLowering::LowerFormalArguments(
1061 if (VA.isRegLoc()) {
1062 EVT RegVT = VA.getLocVT();
1065 RC = &AVR::GPR8RegClass;
1067 RC = &AVR::DREGSRegClass;
1081 switch (VA.getLocInfo()) {
1106 EVT LocVT = VA.getLocVT();
1110 VA.getLocMemOffset(),
true);
1124 unsigned StackSize = CCInfo.getNextStackOffset();
1167 F = cast<Function>(GV);
1171 dyn_cast<ExternalSymbolSDNode>(Callee)) {
1180 unsigned NumBytes = CCInfo.getNextStackOffset();
1188 bool HasStackArgs =
false;
1189 for (AI = 0, AE = ArgLocs.size(); AI != AE; ++AI) {
1217 HasStackArgs =
true;
1231 for (AE = AI, AI = ArgLocs.size(); AI != AE; --AI) {
1232 unsigned Loc = AI - 1;
1245 DAG.
getStore(Chain, DL, Arg, PtrOff,
1255 for (
auto Reg : RegsToPass) {
1268 for (
auto Reg : RegsToPass) {
1277 assert(Mask &&
"Missing call preserved mask for calling convention");
1297 return LowerCallResult(Chain, InFlag, CallConv, isVarArg, Ins, DL, DAG,
1304 SDValue AVRTargetLowering::LowerCallResult(
1315 auto CCFunction = CCAssignFnForReturn(CallConv);
1316 CCInfo.AnalyzeCallResult(Ins, CCFunction);
1326 Chain = DAG.
getCopyFromReg(Chain, dl, RVLoc.getLocReg(), RVLoc.getValVT(),
1343 return RetCC_AVR_BUILTIN;
1356 CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
1358 auto CCFunction = CCAssignFnForReturn(CallConv);
1376 auto CCFunction = CCAssignFnForReturn(CallConv);
1377 CCInfo.AnalyzeReturn(Outs, CCFunction);
1382 unsigned e = RVLocs.
size();
1393 for (
unsigned i = 0; i != e; ++i) {
1418 if (Flag.getNode()) {
1444 RC = &AVR::GPR8RegClass;
1448 RC = &AVR::DREGSRegClass;
1452 RC = &AVR::GPR8RegClass;
1456 RC = &AVR::DREGSRegClass;
1460 RC = &AVR::GPR8RegClass;
1464 RC = &AVR::DREGSRegClass;
1468 RC = &AVR::GPR8RegClass;
1472 RC = &AVR::DREGSRegClass;
1476 RC = &AVR::GPR8RegClass;
1480 RC = &AVR::DREGSRegClass;
1488 if (I != F->
end()) ++I;
1521 BuildMI(BB, dl, TII.
get(AVR::BREQk)).addMBB(RemBB);
1528 BuildMI(LoopBB, dl, TII.
get(AVR::PHI), ShiftReg)
1533 BuildMI(LoopBB, dl, TII.
get(AVR::PHI), ShiftAmtReg)
1534 .addReg(ShiftAmtSrcReg)
1538 BuildMI(LoopBB, dl, TII.
get(Opc), ShiftReg2).addReg(ShiftReg);
1539 BuildMI(LoopBB, dl, TII.
get(AVR::SUBIRdK), ShiftAmtReg2)
1540 .addReg(ShiftAmtReg)
1542 BuildMI(LoopBB, dl, TII.
get(AVR::BRNEk)).addMBB(LoopBB);
1557 if (I->getOpcode() == AVR::COPY) {
1558 unsigned SrcReg = I->getOperand(1).getReg();
1559 return (SrcReg == AVR::R0 || SrcReg == AVR::R1);
1602 return insertShift(MI, MBB);
1605 return insertMul(MI, MBB);
1608 assert((Opc == AVR::Select16 || Opc == AVR::Select8) &&
1609 "Unexpected instr type to insert");
1629 for (I = MF->
begin(); I != MF->
end() && &(*I) != MBB; ++
I);
1630 if (I != MF->
end()) ++I;
1643 BuildMI(MBB, dl, TII.get(AVR::RJMPk)).addMBB(falseMBB);
1648 BuildMI(falseMBB, dl, TII.get(AVR::RJMPk)).addMBB(trueMBB);
1668 if (Constraint.
size() == 1) {
1670 switch (Constraint[0]) {
1710 switch (ConstraintCode[0]) {
1726 if (!CallOperandVal) {
1731 switch (*constraint) {
1752 if (
const ConstantFP *
C = dyn_cast<ConstantFP>(CallOperandVal)) {
1759 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1760 if (isUInt<6>(
C->getZExtValue())) {
1766 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1767 if ((
C->getSExtValue() >= -63) && (
C->getSExtValue() <= 0)) {
1773 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1774 if (
C->getZExtValue() == 2) {
1780 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1781 if (
C->getZExtValue() == 0) {
1787 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1794 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1795 if (
C->getSExtValue() == -1) {
1801 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1802 if ((
C->getZExtValue() == 8) || (
C->getZExtValue() == 16) ||
1803 (
C->getZExtValue() == 24)) {
1809 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1810 if (
C->getZExtValue() == 1) {
1816 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1817 if ((
C->getSExtValue() >= -6) && (
C->getSExtValue() <= 5)) {
1830 std::pair<unsigned, const TargetRegisterClass *>
1835 .getSubtargetImpl();
1842 if (Constraint.
size() == 1) {
1843 switch (Constraint[0]) {
1845 return std::make_pair(0U, &AVR::LD8loRegClass);
1847 return std::make_pair(0U, &AVR::PTRDISPREGSRegClass);
1849 return std::make_pair(0U, &AVR::LD8RegClass);
1851 return std::make_pair(0U, &AVR::GPR8loRegClass);
1853 return std::make_pair(0U, &AVR::PTRREGSRegClass);
1855 return std::make_pair(0U, &AVR::GPRSPRegClass);
1858 return std::make_pair(0U, &AVR::GPR8RegClass);
1861 return std::make_pair(0U, &AVR::DREGSRegClass);
1863 return std::make_pair(
unsigned(AVR::R0), &AVR::GPR8RegClass);
1865 return std::make_pair(0U, &AVR::IWREGSRegClass);
1868 return std::make_pair(
unsigned(AVR::R27R26), &AVR::PTRREGSRegClass);
1871 return std::make_pair(
unsigned(AVR::R29R28), &AVR::PTRREGSRegClass);
1874 return std::make_pair(
unsigned(AVR::R31R30), &AVR::PTRREGSRegClass);
1885 std::string &Constraint,
1886 std::vector<SDValue> &Ops,
1893 if (Constraint.length() != 1) {
1897 char ConstraintLetter = Constraint[0];
1898 switch (ConstraintLetter) {
1918 switch (ConstraintLetter) {
1920 if (!isUInt<6>(CUVal64))
1925 if (CVal64 < -63 || CVal64 > 0)
1956 if (CUVal64 != 8 && CUVal64 != 16 && CUVal64 != 24)
1966 if (CVal64 < -6 || CVal64 > 5)
1976 if (!FC || !FC->
isZero())
1984 Ops.push_back(Result);
2001 .
Case(
"r9", AVR::R9).
Case(
"r10", AVR::R10).
Case(
"r11", AVR::R11)
2002 .
Case(
"r12", AVR::R12).
Case(
"r13", AVR::R13).
Case(
"r14", AVR::R14)
2003 .
Case(
"r15", AVR::R15).
Case(
"r16", AVR::R16).
Case(
"r17", AVR::R17)
2004 .
Case(
"r18", AVR::R18).
Case(
"r19", AVR::R19).
Case(
"r20", AVR::R20)
2005 .
Case(
"r21", AVR::R21).
Case(
"r22", AVR::R22).
Case(
"r23", AVR::R23)
2006 .
Case(
"r24", AVR::R24).
Case(
"r25", AVR::R25).
Case(
"r26", AVR::R26)
2007 .
Case(
"r27", AVR::R27).
Case(
"r28", AVR::R28).
Case(
"r29", AVR::R29)
2008 .
Case(
"r30", AVR::R30).
Case(
"r31", AVR::R31)
2009 .
Case(
"X", AVR::R27R26).
Case(
"Y", AVR::R29R28).
Case(
"Z", AVR::R31R30)
2013 .Case(
"r0", AVR::R1R0).
Case(
"r2", AVR::R3R2)
2014 .
Case(
"r4", AVR::R5R4).
Case(
"r6", AVR::R7R6)
2015 .
Case(
"r8", AVR::R9R8).
Case(
"r10", AVR::R11R10)
2016 .
Case(
"r12", AVR::R13R12).
Case(
"r14", AVR::R15R14)
2017 .
Case(
"r16", AVR::R17R16).
Case(
"r18", AVR::R19R18)
2018 .
Case(
"r20", AVR::R21R20).
Case(
"r22", AVR::R23R22)
2019 .
Case(
"r24", AVR::R25R24).
Case(
"r26", AVR::R27R26)
2020 .
Case(
"r28", AVR::R29R28).
Case(
"r30", AVR::R31R30)
2021 .
Case(
"X", AVR::R27R26).
Case(
"Y", AVR::R29R28).
Case(
"Z", AVR::R31R30)
static StringRef getFunctionName(TargetLowering::CallLoweringInfo &CLI)
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.
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
const AVRInstrInfo * getInstrInfo() const override
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
EVT getValueType() const
Return the ValueType of the referenced return value.
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified load with extension does not work with the specified type and indicate wh...
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant, which is required to be operand #1) half of the integer or float value specified as operand #0.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
void setMinimumJumpTableEntries(unsigned Val)
Indicate the minimum number of blocks to generate jump tables.
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, const SDLoc &DL)
Return a new CALLSEQ_END node, which always must have a glue result (to ensure it's not CSE'd)...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
BR_CC - Conditional branch.
Compute iterated dominance frontiers using a linear time algorithm.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
This callback is invoked for operations that are unsupported by the target, which are registered to u...
Carry-setting nodes for multiple precision addition and subtraction.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const
Lower the specified operand into the Ops vector.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, SelectionDAG &DAG) const override
Returns true by value, base pointer and offset pointer and addressing mode by reference if this node ...
unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
void AnalyzeFormalArguments(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals in...
unsigned getReg() const
getReg - Returns the register number.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
STACKRESTORE has two operands, an input chain and a pointer to restore to it returns an output chain...
static void parseFunctionArgs(const SmallVectorImpl< ISD::InputArg > &Ins, SmallVectorImpl< unsigned > &Out)
For each argument in a function store the number of pieces it is composed of.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit...
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change...
A wrapper node for TargetConstantPool, TargetExternalSymbol, and TargetGlobalAddress.
Function Alias Analysis Results
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
void setBooleanVectorContents(BooleanContent Ty)
Specify how the target extends the result of a vector boolean value from a vector of i1 to a wider ty...
Test for zero or minus instruction.
unsigned const TargetRegisterInfo * TRI
CallLoweringInfo & setDebugLoc(const SDLoc &dl)
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned char TargetFlags=0)
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
ConstraintType getConstraintType(StringRef Constraint) const override
Given a constraint, return the type of constraint it is for this target.
Compare with carry instruction.
Value * CallOperandVal
If this is the result output operand or a clobber, this is null, otherwise it is the incoming operand...
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
SDValue getExternalSymbol(const char *Sym, EVT VT)
static void parseExternFuncCallArgs(const SmallVectorImpl< ISD::OutputArg > &In, SmallVectorImpl< unsigned > &Out)
For external symbols there is no function prototype information so we have to rely directly on argume...
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
const AVRSubtarget * getSubtargetImpl() const
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
The address of a basic block.
Represents an abstract call instruction, which includes a bunch of information.
A loop of single right bit rotate instructions.
const HexagonInstrInfo * TII
Shift and rotation operations.
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
bool isProgramMemoryAccess(MemSDNode const *N)
CallLoweringInfo & setChain(SDValue InChain)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
void addLoc(const CCValAssign &V)
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS, Instruction *I=nullptr) const override
Return true if the addressing mode represented by AM is legal for this target, for a load/store of th...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt) Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amt) For double-word atomic operations: ValLo, ValHi, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amtLo, amtHi) ValLo, ValHi, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amtLo, amtHi) These correspond to the atomicrmw instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action)
Indicate that the specified operation does not work with the specified type and indicate what to do a...
const DataLayout & getDataLayout() const
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
LocInfo getLocInfo() const
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
static StructType * get(LLVMContext &Context, ArrayRef< Type *> Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
SmallVector< ISD::InputArg, 32 > Ins
STACKSAVE - STACKSAVE has one operand, an input chain.
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
int64_t getSExtValue() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
A generic AVR implementation.
Utilities related to the AVR instruction set.
MachineFunction & getMachineFunction() const
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose...
SDValue getRegisterMask(const uint32_t *RegMask)
CallingConv::ID getLibcallCallingConv(RTLIB::Libcall Call) const
Get the CallingConv that should be used for the specified libcall.
This contains information for each constraint that we are lowering.
Simple integer binary arithmetic operators.
SmallVector< ISD::OutputArg, 32 > Outs
CallLoweringInfo & setZExtResult(bool Value=true)
unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const override
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override
Return the ValueType of the result of SETCC operations.
AttributeList getAttributes() const
Return the attribute list for this Function.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
static Error getOffset(const SymbolRef &Sym, SectionRef Sec, uint64_t &Result)
virtual const TargetInstrInfo * getInstrInfo() const
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const
amdgpu Simplify well known AMD library false Value * Callee
const char * getTargetNodeName(unsigned Opcode) const override
This method returns the name of a target specific DAG node.
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
This class is used to represent ISD::STORE nodes.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
static CCValAssign getReg(unsigned ValNo, MVT ValVT, unsigned RegNo, MVT LocVT, LocInfo HTP)
Flag
These should be considered private to the implementation of the MCInstrDesc class.
TargetInstrInfo - Interface to description of machine instruction set.
bool isZero() const
Return true if the value is positive or negative zero.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
A switch()-like statement whose cases are string literals.
virtual const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const
Return a mask of call-preserved registers for the given calling convention on the current function...
constexpr bool isUInt< 8 >(uint64_t x)
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...
Contains AVR-specific information for each MachineFunction.
LLVM Basic Block Representation.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type...
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
static void analyzeStandardArguments(TargetLowering::CallLoweringInfo *CLI, const Function *F, const DataLayout *TD, const SmallVectorImpl< ISD::OutputArg > *Outs, const SmallVectorImpl< ISD::InputArg > *Ins, CallingConv::ID CallConv, SmallVectorImpl< CCValAssign > &ArgLocs, CCState &CCInfo, bool IsCall, bool IsVarArg)
Analyze incoming and outgoing function arguments.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
iterator_range< value_op_iterator > op_values() const
Calling convention used for AVR signal routines.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
const SDValue & getOperand(unsigned Num) const
Calling convention used for special AVR rtlib functions which have an "optimized" convention to prese...
Carry-using nodes for multiple precision addition and subtraction.
LLVMContext & getContext() const
ConstantFP - Floating Point Values [float, double].
SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize, const SDLoc &DL)
Return a new CALLSEQ_START node, that starts new call frame, in which InSize bytes are set up inside ...
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override
Return true if folding a constant offset with the given GlobalAddress is legal.
bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, SelectionDAG &DAG) const override
Returns true by value, base pointer and offset pointer and addressing mode by reference if the node's...
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
Replace a node with an illegal result type with a new node built out of custom code.
virtual ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &info, const char *constraint) const
Examine constraint string and operand type and determine a weight value.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
self_iterator getIterator()
AVR conditional branches.
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
CondCodes
AVR specific condition codes.
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo...
std::vector< ArgListEntry > ArgListTy
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This structure contains all information that is necessary for lowering calls.
const TargetMachine & getTargetMachine() const
This class contains a discriminated union of information about pointers in memory operands...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void setLibcallCallingConv(RTLIB::Libcall Call, CallingConv::ID CC)
Set the CallingConv that should be used for the specified libcall.
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
AVRTargetLowering(AVRTargetMachine &TM)
A loop of single logical shift right instructions.
Iterator for intrusive lists based on ilist_node.
CCState - This class holds information needed while lowering arguments and return values...
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
This is the shared class of boolean and integer constants.
static void analyzeBuiltinArguments(TargetLowering::CallLoweringInfo &CLI, const Function *F, const DataLayout *TD, const SmallVectorImpl< ISD::OutputArg > *Outs, const SmallVectorImpl< ISD::InputArg > *Ins, CallingConv::ID CallConv, SmallVectorImpl< CCValAssign > &ArgLocs, CCState &CCInfo, bool IsCall, bool IsVarArg)
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
unsigned getRegisterByName(const char *RegName, EVT VT, SelectionDAG &DAG) const override
Return the register ID of the name passed in.
CCValAssign - Represent assignment of one arg/retval to a location.
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
A loop of single left bit rotate instructions.
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
BRCOND - Conditional branch.
Byte Swap and Counting operators.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
CallLoweringInfo & setSExtResult(bool Value=true)
Represents one node in the SelectionDAG.
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
static mvt_range integer_valuetypes()
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const override
Lower the specified operand into the Ops vector.
void setIndexedLoadAction(unsigned IdxMode, MVT VT, LegalizeAction Action)
Indicate that the specified indexed load does or does not work with the specified type and indicate w...
Select(COND, TRUEVAL, FALSEVAL).
void setMinFunctionAlignment(unsigned Align)
Set the target's minimum function alignment (in log2(bytes))
ZERO_EXTEND - Used for integer types, zeroing the new bits.
void AnalyzeCallOperands(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeCallOperands - Analyze the outgoing arguments to a call, incorporating info about the passed v...
ANY_EXTEND - Used for integer types. The high bits are undefined.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
amdgpu Simplify well known AMD library false Value Value * Arg
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
A loop of single logical shift left instructions.
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
Used for AVR interrupt routines.
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
BR_JT - Jumptable branch.
Representation of each machine instruction.
VACOPY - VACOPY has 5 operands: an input chain, a destination pointer, a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the source.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned char TargetFlags=0)
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
SmallVector< SDValue, 32 > OutVals
bool CheckReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
CheckReturn - Analyze the return values of a function, returning true if the return can be performed ...
bool isVector() const
Return true if this is a vector value type.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
unsigned getLocMemOffset() const
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
LLVM_NODISCARD bool empty() const
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
int getVarArgsFrameIndex() const
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
static bool isCopyMulResult(MachineBasicBlock::iterator const &I)
A loop of single arithmetic shift right instructions.
void setStackPointerRegisterToSaveRestore(unsigned R)
If set to a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save and restore.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
static void analyzeArguments(TargetLowering::CallLoweringInfo *CLI, const Function *F, const DataLayout *TD, const SmallVectorImpl< ISD::OutputArg > *Outs, const SmallVectorImpl< ISD::InputArg > *Ins, CallingConv::ID CallConv, SmallVectorImpl< CCValAssign > &ArgLocs, CCState &CCInfo, bool IsCall, bool IsVarArg)
void setLibcallName(RTLIB::Libcall Call, const char *Name)
Rename the default libcall routine name for the specified libcall.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
static CCValAssign getMem(unsigned ValNo, MVT ValVT, unsigned Offset, MVT LocVT, LocInfo HTP)
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
unsigned getOpcode() const
SDValue getValue(unsigned R) const
void setVarArgsFrameIndex(int Idx)
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
void setSupportsUnalignedAtomics(bool UnalignedSupported)
Sets whether unaligned atomic operations are supported.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
const MCInstrDesc & getBrCond(AVRCC::CondCodes CC) const
Operand 0 and operand 1 are selection variable, operand 2 is condition code and operand 3 is flag ope...
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
CallLoweringInfo & setInRegister(bool Value=true)
LLVM Value Representation.
SDValue getRegister(unsigned Reg, EVT VT)
std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override
Given a physical register constraint (e.g.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
SDValue getValueType(EVT)
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
const AVRRegisterInfo * getRegisterInfo() const override
static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset, uint8_t ID=0)
Stack pointer relative access.
StringRef - Represent a constant reference to a string, i.e.
SetCC operator - This evaluates to a true value iff the condition is true.
const SDValue & getOperand(unsigned i) const
ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &info, const char *constraint) const override
Examine constraint string and operand type and determine a weight value.
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
unsigned getLocReg() const
uint64_t getZExtValue() const
TRUNCATE - Completely drop the high bits.
unsigned AllocateReg(unsigned Reg)
AllocateReg - Attempt to allocate one register.
const MachineOperand & getOperand(unsigned i) const
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
static AVRCC::CondCodes intCCToAVRCC(ISD::CondCode CC)
IntCCToAVRCC - Convert a DAG integer condition code to an AVR CC.
unsigned AllocateStack(unsigned Size, unsigned Align)
AllocateStack - Allocate a chunk of stack space with the specified size and alignment.
LLVMContext * getContext() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
CallLoweringInfo & setLibCallee(CallingConv::ID CC, Type *ResultType, SDValue Target, ArgListTy &&ArgsList)
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
void setIndexedStoreAction(unsigned IdxMode, MVT VT, LegalizeAction Action)
Indicate that the specified indexed store does or does not work with the specified type and indicate ...
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
This class is used to represent ISD::LOAD nodes.
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...