310 uint64_t ShiftAmount = cast<ConstantSDNode>(N->
getOperand(1))->getZExtValue();
333 while (ShiftAmount--) {
334 Victim = DAG.
getNode(Opc8, dl, VT, Victim);
343 "Invalid opcode for Div/Rem lowering");
353 LC = IsSigned ? RTLIB::SDIVREM_I8 : RTLIB::UDIVREM_I8;
356 LC = IsSigned ? RTLIB::SDIVREM_I16 : RTLIB::UDIVREM_I16;
359 LC = IsSigned ? RTLIB::SDIVREM_I32 : RTLIB::UDIVREM_I32;
362 LC = IsSigned ? RTLIB::SDIVREM_I64 : RTLIB::UDIVREM_I64;
365 LC = IsSigned ? RTLIB::SDIVREM_I128 : RTLIB::UDIVREM_I128;
378 Args.push_back(Entry);
396 return CallInfo.first;
403 const GlobalValue *GV = cast<GlobalAddressSDNode>(
Op)->getGlobal();
415 const BlockAddress *BA = cast<BlockAddressSDNode>(
Op)->getBlockAddress();
449 bool UseTest =
false;
462 switch (
C->getSExtValue()) {
495 switch (
C->getSExtValue()) {
629 SDValue Cmp = getAVRCmp(LHS, RHS, CC, TargetCC, DAG, dl);
644 SDValue Cmp = getAVRCmp(LHS, RHS, CC, TargetCC, DAG, dl);
647 SDValue Ops[] = {TrueV, FalseV, TargetCC, Cmp};
659 SDValue Cmp = getAVRCmp(LHS, RHS, CC, TargetCC, DAG, DL);
664 SDValue Ops[] = {TrueV, FalseV, TargetCC, Cmp};
693 return LowerShifts(Op, DAG);
695 return LowerGlobalAddress(Op, DAG);
697 return LowerBlockAddress(Op, DAG);
699 return LowerBR_CC(Op, DAG);
701 return LowerSELECT_CC(Op, DAG);
703 return LowerSETCC(Op, DAG);
705 return LowerVASTART(Op, DAG);
708 return LowerDivRem(Op, DAG);
727 DAG.
getConstant(-
C->getAPIntValue(), DL,
C->getValueType(0)));
782 VT =
LD->getMemoryVT();
783 Op =
LD->getBasePtr().getNode();
789 }
else if (
const StoreSDNode *
ST = dyn_cast<StoreSDNode>(N)) {
790 VT =
ST->getMemoryVT();
791 Op =
ST->getBasePtr().getNode();
808 int RHSC = RHS->getSExtValue();
838 VT =
LD->getMemoryVT();
841 }
else if (
const StoreSDNode *
ST = dyn_cast<StoreSDNode>(N)) {
842 VT =
ST->getMemoryVT();
859 int RHSC = RHS->getSExtValue();
885 #include "AVRGenCallingConv.inc" 892 if(
Arg.PartOffset > 0)
continue;
893 unsigned Bytes = ((
Arg.ArgVT.getSizeInBits()) + 7) / 8;
903 for (
unsigned i = 0, e = In.
size(); i != e;) {
906 while ((i != e) && (In[i].PartOffset ==
Offset)) {
907 Offset += In[i].VT.getStoreSize();
919 return G->getSymbol();
923 return G->getGlobal()->getName();
939 CCState &CCInfo,
bool IsCall,
bool IsVarArg) {
940 static const MCPhysReg RegList8[] = {AVR::R24, AVR::R22, AVR::R20,
941 AVR::R18, AVR::R16, AVR::R14,
942 AVR::R12, AVR::R10, AVR::R8};
943 static const MCPhysReg RegList16[] = {AVR::R25R24, AVR::R23R22, AVR::R21R20,
944 AVR::R19R18, AVR::R17R16, AVR::R15R14,
945 AVR::R13R12, AVR::R11R10, AVR::R9R8};
961 assert(F !=
nullptr &&
"function should not be null");
967 bool UsesStack =
false;
968 for (
unsigned i = 0, pos = 0, e = Args.
size(); i != e; ++i) {
969 unsigned Size = Args[i];
974 if (Size == 0)
continue;
976 MVT LocVT = (IsCall) ? (*Outs)[pos].VT : (*Ins)[pos].VT;
979 if (!UsesStack && (Size <= RegsLeft)) {
982 for (
unsigned j = 0; j !=
Size; ++j) {
996 for (
unsigned j = 0; j !=
Size; ++j) {
1015 CCState &CCInfo,
bool IsCall,
bool IsVarArg) {
1022 CallConv, ArgLocs, CCInfo,
1033 CCState &CCInfo,
bool IsCall,
bool IsVarArg) {
1037 CallConv, ArgLocs, CCInfo,
1043 CallConv, ArgLocs, CCInfo,
1050 SDValue AVRTargetLowering::LowerFormalArguments(
1070 if (VA.isRegLoc()) {
1071 EVT RegVT = VA.getLocVT();
1074 RC = &AVR::GPR8RegClass;
1076 RC = &AVR::DREGSRegClass;
1090 switch (VA.getLocInfo()) {
1115 EVT LocVT = VA.getLocVT();
1119 VA.getLocMemOffset(),
true);
1133 unsigned StackSize = CCInfo.getNextStackOffset();
1176 F = cast<Function>(GV);
1180 dyn_cast<ExternalSymbolSDNode>(Callee)) {
1189 unsigned NumBytes = CCInfo.getNextStackOffset();
1197 bool HasStackArgs =
false;
1198 for (AI = 0, AE = ArgLocs.size(); AI != AE; ++AI) {
1226 HasStackArgs =
true;
1240 for (AE = AI, AI = ArgLocs.size(); AI != AE; --AI) {
1241 unsigned Loc = AI - 1;
1254 DAG.
getStore(Chain, DL, Arg, PtrOff,
1264 for (
auto Reg : RegsToPass) {
1277 for (
auto Reg : RegsToPass) {
1286 assert(Mask &&
"Missing call preserved mask for calling convention");
1306 return LowerCallResult(Chain, InFlag, CallConv, isVarArg, Ins, DL, DAG,
1313 SDValue AVRTargetLowering::LowerCallResult(
1324 auto CCFunction = CCAssignFnForReturn(CallConv);
1325 CCInfo.AnalyzeCallResult(Ins, CCFunction);
1335 Chain = DAG.
getCopyFromReg(Chain, dl, RVLoc.getLocReg(), RVLoc.getValVT(),
1352 return RetCC_AVR_BUILTIN;
1365 CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
1367 auto CCFunction = CCAssignFnForReturn(CallConv);
1385 auto CCFunction = CCAssignFnForReturn(CallConv);
1386 CCInfo.AnalyzeReturn(Outs, CCFunction);
1391 unsigned e = RVLocs.
size();
1402 for (
unsigned i = 0; i != e; ++i) {
1427 if (Flag.getNode()) {
1442 bool HasRepeatedOperand =
false;
1454 RC = &AVR::GPR8RegClass;
1455 HasRepeatedOperand =
true;
1459 RC = &AVR::DREGSRegClass;
1463 RC = &AVR::GPR8RegClass;
1467 RC = &AVR::DREGSRegClass;
1471 RC = &AVR::GPR8RegClass;
1475 RC = &AVR::DREGSRegClass;
1479 RC = &AVR::GPR8RegClass;
1480 HasRepeatedOperand =
true;
1484 RC = &AVR::DREGSRegClass;
1488 RC = &AVR::GPR8RegClass;
1492 RC = &AVR::DREGSRegClass;
1500 if (I != F->
end()) ++I;
1533 BuildMI(BB, dl, TII.
get(AVR::BREQk)).addMBB(RemBB);
1540 BuildMI(LoopBB, dl, TII.
get(AVR::PHI), ShiftReg)
1545 BuildMI(LoopBB, dl, TII.
get(AVR::PHI), ShiftAmtReg)
1546 .addReg(ShiftAmtSrcReg)
1551 auto ShiftMI =
BuildMI(LoopBB, dl, TII.
get(Opc), ShiftReg2).addReg(ShiftReg);
1552 if (HasRepeatedOperand)
1553 ShiftMI.addReg(ShiftReg);
1555 BuildMI(LoopBB, dl, TII.
get(AVR::SUBIRdK), ShiftAmtReg2)
1556 .addReg(ShiftAmtReg)
1558 BuildMI(LoopBB, dl, TII.
get(AVR::BRNEk)).addMBB(LoopBB);
1573 if (I->getOpcode() == AVR::COPY) {
1574 unsigned SrcReg = I->getOperand(1).getReg();
1575 return (SrcReg == AVR::R0 || SrcReg == AVR::R1);
1618 return insertShift(MI, MBB);
1621 return insertMul(MI, MBB);
1624 assert((Opc == AVR::Select16 || Opc == AVR::Select8) &&
1625 "Unexpected instr type to insert");
1645 for (I = MF->
begin(); I != MF->
end() && &(*I) != MBB; ++
I);
1646 if (I != MF->
end()) ++I;
1659 BuildMI(MBB, dl, TII.get(AVR::RJMPk)).addMBB(falseMBB);
1664 BuildMI(falseMBB, dl, TII.get(AVR::RJMPk)).addMBB(trueMBB);
1684 if (Constraint.
size() == 1) {
1686 switch (Constraint[0]) {
1726 switch (ConstraintCode[0]) {
1742 if (!CallOperandVal) {
1747 switch (*constraint) {
1768 if (
const ConstantFP *
C = dyn_cast<ConstantFP>(CallOperandVal)) {
1775 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1776 if (isUInt<6>(
C->getZExtValue())) {
1782 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1783 if ((
C->getSExtValue() >= -63) && (
C->getSExtValue() <= 0)) {
1789 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1790 if (
C->getZExtValue() == 2) {
1796 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1797 if (
C->getZExtValue() == 0) {
1803 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1810 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1811 if (
C->getSExtValue() == -1) {
1817 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1818 if ((
C->getZExtValue() == 8) || (
C->getZExtValue() == 16) ||
1819 (
C->getZExtValue() == 24)) {
1825 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1826 if (
C->getZExtValue() == 1) {
1832 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1833 if ((
C->getSExtValue() >= -6) && (
C->getSExtValue() <= 5)) {
1846 std::pair<unsigned, const TargetRegisterClass *>
1855 if (Constraint.
size() == 1) {
1856 switch (Constraint[0]) {
1858 return std::make_pair(0U, &AVR::LD8loRegClass);
1860 return std::make_pair(0U, &AVR::PTRDISPREGSRegClass);
1862 return std::make_pair(0U, &AVR::LD8RegClass);
1864 return std::make_pair(0U, &AVR::GPR8loRegClass);
1866 return std::make_pair(0U, &AVR::PTRREGSRegClass);
1868 return std::make_pair(0U, &AVR::GPRSPRegClass);
1871 return std::make_pair(0U, &AVR::GPR8RegClass);
1874 return std::make_pair(0U, &AVR::DREGSRegClass);
1876 return std::make_pair(
unsigned(AVR::R0), &AVR::GPR8RegClass);
1878 return std::make_pair(0U, &AVR::IWREGSRegClass);
1881 return std::make_pair(
unsigned(AVR::R27R26), &AVR::PTRREGSRegClass);
1884 return std::make_pair(
unsigned(AVR::R29R28), &AVR::PTRREGSRegClass);
1887 return std::make_pair(
unsigned(AVR::R31R30), &AVR::PTRREGSRegClass);
1898 std::string &Constraint,
1899 std::vector<SDValue> &Ops,
1906 if (Constraint.length() != 1) {
1910 char ConstraintLetter = Constraint[0];
1911 switch (ConstraintLetter) {
1931 switch (ConstraintLetter) {
1933 if (!isUInt<6>(CUVal64))
1938 if (CVal64 < -63 || CVal64 > 0)
1969 if (CUVal64 != 8 && CUVal64 != 16 && CUVal64 != 24)
1979 if (CVal64 < -6 || CVal64 > 5)
1989 if (!FC || !FC->
isZero())
1997 Ops.push_back(Result);
2014 .
Case(
"r9", AVR::R9).
Case(
"r10", AVR::R10).
Case(
"r11", AVR::R11)
2015 .
Case(
"r12", AVR::R12).
Case(
"r13", AVR::R13).
Case(
"r14", AVR::R14)
2016 .
Case(
"r15", AVR::R15).
Case(
"r16", AVR::R16).
Case(
"r17", AVR::R17)
2017 .
Case(
"r18", AVR::R18).
Case(
"r19", AVR::R19).
Case(
"r20", AVR::R20)
2018 .
Case(
"r21", AVR::R21).
Case(
"r22", AVR::R22).
Case(
"r23", AVR::R23)
2019 .
Case(
"r24", AVR::R24).
Case(
"r25", AVR::R25).
Case(
"r26", AVR::R26)
2020 .
Case(
"r27", AVR::R27).
Case(
"r28", AVR::R28).
Case(
"r29", AVR::R29)
2021 .
Case(
"r30", AVR::R30).
Case(
"r31", AVR::R31)
2022 .
Case(
"X", AVR::R27R26).
Case(
"Y", AVR::R29R28).
Case(
"Z", AVR::R31R30)
2026 .Case(
"r0", AVR::R1R0).
Case(
"r2", AVR::R3R2)
2027 .
Case(
"r4", AVR::R5R4).
Case(
"r6", AVR::R7R6)
2028 .
Case(
"r8", AVR::R9R8).
Case(
"r10", AVR::R11R10)
2029 .
Case(
"r12", AVR::R13R12).
Case(
"r14", AVR::R15R14)
2030 .
Case(
"r16", AVR::R17R16).
Case(
"r18", AVR::R19R18)
2031 .
Case(
"r20", AVR::R21R20).
Case(
"r22", AVR::R23R22)
2032 .
Case(
"r24", AVR::R25R24).
Case(
"r26", AVR::R27R26)
2033 .
Case(
"r28", AVR::R29R28).
Case(
"r30", AVR::R31R30)
2034 .
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
Used for AVR interrupt routines.
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.
This class represents lattice values for constants.
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.
void push_back(const T &Elt)
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.
AVRTargetLowering(const AVRTargetMachine &TM, const AVRSubtarget &STI)
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 ...
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.
const AVRSubtarget & Subtarget
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.
Calling convention used for special AVR rtlib functions which have an "optimized" convention to prese...
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
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
const SDValue & getOperand(unsigned Num) const
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...
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.
Calling convention used for AVR signal routines.
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))
A specific AVR target MCU.
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.
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.
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.
bool supportsMultiplication() const
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...