309 uint64_t ShiftAmount = cast<ConstantSDNode>(N->
getOperand(1))->getZExtValue();
332 while (ShiftAmount--) {
333 Victim = DAG.
getNode(Opc8, dl, VT, Victim);
342 "Invalid opcode for Div/Rem lowering");
352 LC = IsSigned ? RTLIB::SDIVREM_I8 : RTLIB::UDIVREM_I8;
355 LC = IsSigned ? RTLIB::SDIVREM_I16 : RTLIB::UDIVREM_I16;
358 LC = IsSigned ? RTLIB::SDIVREM_I32 : RTLIB::UDIVREM_I32;
361 LC = IsSigned ? RTLIB::SDIVREM_I64 : RTLIB::UDIVREM_I64;
364 LC = IsSigned ? RTLIB::SDIVREM_I128 : RTLIB::UDIVREM_I128;
377 Args.push_back(Entry);
395 return CallInfo.first;
402 const GlobalValue *GV = cast<GlobalAddressSDNode>(
Op)->getGlobal();
414 const BlockAddress *BA = cast<BlockAddressSDNode>(
Op)->getBlockAddress();
448 bool UseTest =
false;
461 switch (
C->getSExtValue()) {
494 switch (
C->getSExtValue()) {
628 SDValue Cmp = getAVRCmp(LHS, RHS, CC, TargetCC, DAG, dl);
643 SDValue Cmp = getAVRCmp(LHS, RHS, CC, TargetCC, DAG, dl);
646 SDValue Ops[] = {TrueV, FalseV, TargetCC, Cmp};
658 SDValue Cmp = getAVRCmp(LHS, RHS, CC, TargetCC, DAG, DL);
663 SDValue Ops[] = {TrueV, FalseV, TargetCC, Cmp};
692 return LowerShifts(Op, DAG);
694 return LowerGlobalAddress(Op, DAG);
696 return LowerBlockAddress(Op, DAG);
698 return LowerBR_CC(Op, DAG);
700 return LowerSELECT_CC(Op, DAG);
702 return LowerSETCC(Op, DAG);
704 return LowerVASTART(Op, DAG);
707 return LowerDivRem(Op, DAG);
726 DAG.
getConstant(-
C->getAPIntValue(), DL,
C->getValueType(0)));
781 VT =
LD->getMemoryVT();
782 Op =
LD->getBasePtr().getNode();
788 }
else if (
const StoreSDNode *
ST = dyn_cast<StoreSDNode>(N)) {
789 VT =
ST->getMemoryVT();
790 Op =
ST->getBasePtr().getNode();
807 int RHSC = RHS->getSExtValue();
837 VT =
LD->getMemoryVT();
840 }
else if (
const StoreSDNode *
ST = dyn_cast<StoreSDNode>(N)) {
841 VT =
ST->getMemoryVT();
858 int RHSC = RHS->getSExtValue();
884 #include "AVRGenCallingConv.inc" 891 if(
Arg.PartOffset > 0)
continue;
892 unsigned Bytes = ((
Arg.ArgVT.getSizeInBits()) + 7) / 8;
902 for (
unsigned i = 0,
e = In.
size(); i !=
e;) {
905 while ((i !=
e) && (In[i].PartOffset ==
Offset)) {
906 Offset += In[i].VT.getStoreSize();
918 return G->getSymbol();
922 return G->getGlobal()->getName();
938 CCState &CCInfo,
bool IsCall,
bool IsVarArg) {
939 static const MCPhysReg RegList8[] = {AVR::R24, AVR::R22, AVR::R20,
940 AVR::R18, AVR::R16, AVR::R14,
941 AVR::R12, AVR::R10, AVR::R8};
942 static const MCPhysReg RegList16[] = {AVR::R25R24, AVR::R23R22, AVR::R21R20,
943 AVR::R19R18, AVR::R17R16, AVR::R15R14,
944 AVR::R13R12, AVR::R11R10, AVR::R9R8};
960 assert(F !=
nullptr &&
"function should not be null");
966 bool UsesStack =
false;
967 for (
unsigned i = 0, pos = 0,
e = Args.
size(); i !=
e; ++i) {
968 unsigned Size = Args[i];
973 if (Size == 0)
continue;
975 MVT LocVT = (IsCall) ? (*Outs)[pos].VT : (*Ins)[pos].VT;
978 if (!UsesStack && (Size <= RegsLeft)) {
981 for (
unsigned j = 0; j !=
Size; ++j) {
995 for (
unsigned j = 0; j !=
Size; ++j) {
1014 CCState &CCInfo,
bool IsCall,
bool IsVarArg) {
1021 CallConv, ArgLocs, CCInfo,
1032 CCState &CCInfo,
bool IsCall,
bool IsVarArg) {
1036 CallConv, ArgLocs, CCInfo,
1042 CallConv, ArgLocs, CCInfo,
1049 SDValue AVRTargetLowering::LowerFormalArguments(
1069 if (VA.isRegLoc()) {
1070 EVT RegVT = VA.getLocVT();
1073 RC = &AVR::GPR8RegClass;
1075 RC = &AVR::DREGSRegClass;
1089 switch (VA.getLocInfo()) {
1114 EVT LocVT = VA.getLocVT();
1118 VA.getLocMemOffset(),
true);
1132 unsigned StackSize = CCInfo.getNextStackOffset();
1175 F = cast<Function>(GV);
1179 dyn_cast<ExternalSymbolSDNode>(Callee)) {
1188 unsigned NumBytes = CCInfo.getNextStackOffset();
1196 bool HasStackArgs =
false;
1197 for (AI = 0, AE = ArgLocs.size(); AI != AE; ++AI) {
1225 HasStackArgs =
true;
1239 for (AE = AI, AI = ArgLocs.size(); AI != AE; --AI) {
1240 unsigned Loc = AI - 1;
1253 DAG.
getStore(Chain, DL, Arg, PtrOff,
1263 for (
auto Reg : RegsToPass) {
1276 for (
auto Reg : RegsToPass) {
1284 assert(Mask &&
"Missing call preserved mask for calling convention");
1304 return LowerCallResult(Chain, InFlag, CallConv, isVarArg, Ins, DL, DAG,
1311 SDValue AVRTargetLowering::LowerCallResult(
1322 auto CCFunction = CCAssignFnForReturn(CallConv);
1323 CCInfo.AnalyzeCallResult(Ins, CCFunction);
1333 Chain = DAG.
getCopyFromReg(Chain, dl, RVLoc.getLocReg(), RVLoc.getValVT(),
1350 return RetCC_AVR_BUILTIN;
1363 CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
1365 auto CCFunction = CCAssignFnForReturn(CallConv);
1383 auto CCFunction = CCAssignFnForReturn(CallConv);
1384 CCInfo.AnalyzeReturn(Outs, CCFunction);
1389 unsigned e = RVLocs.
size();
1400 for (
unsigned i = 0; i !=
e; ++i) {
1425 if (Flag.getNode()) {
1440 bool HasRepeatedOperand =
false;
1451 RC = &AVR::GPR8RegClass;
1452 HasRepeatedOperand =
true;
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;
1484 RC = &AVR::GPR8RegClass;
1488 RC = &AVR::DREGSRegClass;
1496 if (I != F->
end()) ++I;
1529 BuildMI(BB, dl, TII.
get(AVR::BREQk)).addMBB(RemBB);
1536 BuildMI(LoopBB, dl, TII.
get(AVR::PHI), ShiftReg)
1541 BuildMI(LoopBB, dl, TII.
get(AVR::PHI), ShiftAmtReg)
1542 .addReg(ShiftAmtSrcReg)
1547 auto ShiftMI =
BuildMI(LoopBB, dl, TII.
get(Opc), ShiftReg2).addReg(ShiftReg);
1548 if (HasRepeatedOperand)
1549 ShiftMI.addReg(ShiftReg);
1551 BuildMI(LoopBB, dl, TII.
get(AVR::SUBIRdK), ShiftAmtReg2)
1552 .addReg(ShiftAmtReg)
1554 BuildMI(LoopBB, dl, TII.
get(AVR::BRNEk)).addMBB(LoopBB);
1569 if (I->getOpcode() == AVR::COPY) {
1570 Register SrcReg = I->getOperand(1).getReg();
1571 return (SrcReg == AVR::R0 || SrcReg == AVR::R1);
1613 return insertShift(MI, MBB);
1616 return insertMul(MI, MBB);
1619 assert((Opc == AVR::Select16 || Opc == AVR::Select8) &&
1620 "Unexpected instr type to insert");
1641 if (FallThrough !=
nullptr) {
1642 BuildMI(MBB, dl, TII.get(AVR::RJMPk)).addMBB(FallThrough);
1649 for (I = MF->
begin(); I != MF->
end() && &(*I) != MBB; ++
I);
1650 if (I != MF->
end()) ++I;
1663 BuildMI(MBB, dl, TII.get(AVR::RJMPk)).addMBB(falseMBB);
1668 BuildMI(falseMBB, dl, TII.get(AVR::RJMPk)).addMBB(trueMBB);
1688 if (Constraint.
size() == 1) {
1690 switch (Constraint[0]) {
1730 switch (ConstraintCode[0]) {
1746 if (!CallOperandVal) {
1751 switch (*constraint) {
1772 if (
const ConstantFP *
C = dyn_cast<ConstantFP>(CallOperandVal)) {
1779 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1780 if (isUInt<6>(
C->getZExtValue())) {
1786 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1787 if ((
C->getSExtValue() >= -63) && (
C->getSExtValue() <= 0)) {
1793 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1794 if (
C->getZExtValue() == 2) {
1800 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1801 if (
C->getZExtValue() == 0) {
1807 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1814 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1815 if (
C->getSExtValue() == -1) {
1821 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1822 if ((
C->getZExtValue() == 8) || (
C->getZExtValue() == 16) ||
1823 (
C->getZExtValue() == 24)) {
1829 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1830 if (
C->getZExtValue() == 1) {
1836 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(CallOperandVal)) {
1837 if ((
C->getSExtValue() >= -6) && (
C->getSExtValue() <= 5)) {
1850 std::pair<unsigned, const TargetRegisterClass *>
1859 if (Constraint.
size() == 1) {
1860 switch (Constraint[0]) {
1862 return std::make_pair(0U, &AVR::LD8loRegClass);
1864 return std::make_pair(0U, &AVR::PTRDISPREGSRegClass);
1866 return std::make_pair(0U, &AVR::LD8RegClass);
1868 return std::make_pair(0U, &AVR::GPR8loRegClass);
1870 return std::make_pair(0U, &AVR::PTRREGSRegClass);
1872 return std::make_pair(0U, &AVR::GPRSPRegClass);
1875 return std::make_pair(0U, &AVR::GPR8RegClass);
1878 return std::make_pair(0U, &AVR::DREGSRegClass);
1880 return std::make_pair(
unsigned(AVR::R0), &AVR::GPR8RegClass);
1882 return std::make_pair(0U, &AVR::IWREGSRegClass);
1885 return std::make_pair(
unsigned(AVR::R27R26), &AVR::PTRREGSRegClass);
1888 return std::make_pair(
unsigned(AVR::R29R28), &AVR::PTRREGSRegClass);
1891 return std::make_pair(
unsigned(AVR::R31R30), &AVR::PTRREGSRegClass);
1902 std::string &Constraint,
1903 std::vector<SDValue> &Ops,
1910 if (Constraint.length() != 1) {
1914 char ConstraintLetter = Constraint[0];
1915 switch (ConstraintLetter) {
1935 switch (ConstraintLetter) {
1937 if (!isUInt<6>(CUVal64))
1942 if (CVal64 < -63 || CVal64 > 0)
1973 if (CUVal64 != 8 && CUVal64 != 16 && CUVal64 != 24)
1983 if (CVal64 < -6 || CVal64 > 5)
1993 if (!FC || !FC->
isZero())
2001 Ops.push_back(Result);
2017 .
Case(
"r9", AVR::R9).
Case(
"r10", AVR::R10).
Case(
"r11", AVR::R11)
2018 .
Case(
"r12", AVR::R12).
Case(
"r13", AVR::R13).
Case(
"r14", AVR::R14)
2019 .
Case(
"r15", AVR::R15).
Case(
"r16", AVR::R16).
Case(
"r17", AVR::R17)
2020 .
Case(
"r18", AVR::R18).
Case(
"r19", AVR::R19).
Case(
"r20", AVR::R20)
2021 .
Case(
"r21", AVR::R21).
Case(
"r22", AVR::R22).
Case(
"r23", AVR::R23)
2022 .
Case(
"r24", AVR::R24).
Case(
"r25", AVR::R25).
Case(
"r26", AVR::R26)
2023 .
Case(
"r27", AVR::R27).
Case(
"r28", AVR::R28).
Case(
"r29", AVR::R29)
2024 .
Case(
"r30", AVR::R30).
Case(
"r31", AVR::R31)
2025 .
Case(
"X", AVR::R27R26).
Case(
"Y", AVR::R29R28).
Case(
"Z", AVR::R31R30)
2029 .Case(
"r0", AVR::R1R0).
Case(
"r2", AVR::R3R2)
2030 .
Case(
"r4", AVR::R5R4).
Case(
"r6", AVR::R7R6)
2031 .
Case(
"r8", AVR::R9R8).
Case(
"r10", AVR::R11R10)
2032 .
Case(
"r12", AVR::R13R12).
Case(
"r14", AVR::R15R14)
2033 .
Case(
"r16", AVR::R17R16).
Case(
"r18", AVR::R19R18)
2034 .
Case(
"r20", AVR::R21R20).
Case(
"r22", AVR::R23R22)
2035 .
Case(
"r24", AVR::R25R24).
Case(
"r26", AVR::R27R26)
2036 .
Case(
"r28", AVR::R29R28).
Case(
"r30", AVR::R31R30)
2037 .
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
A parsed version of the target data layout string in and methods for querying it. ...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
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.
Register getLocReg() const
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...
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
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...
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.
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned TargetFlags=0)
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 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...
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
StringSwitch & Case(StringLiteral S, T Value)
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)
MachineBasicBlock * getFallThrough()
Return the fallthrough block if the block can implicitly transfer control to the block after it by fa...
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...
LLVM_NODISCARD R Default(T Value)
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.
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
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.
void setMinFunctionAlignment(Align Alignment)
Set the target's minimum function alignment.
This contains information for each constraint that we are lowering.
Simple integer binary arithmetic operators.
SmallVector< ISD::OutputArg, 32 > Outs
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
LLVM_NODISCARD size_t size() const
size - Get the string size.
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
static LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const
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.
Calling convention used for AVR signal routines.
This class is used to represent ISD::STORE nodes.
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)
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
const SDValue & getOperand(unsigned Num) const
Carry-using nodes for multiple precision addition and subtraction.
LLVMContext & getContext() const
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
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...
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
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.
Register getRegisterByName(const char *RegName, LLT VT, const MachineFunction &MF) const override
Return the register ID of the name passed in.
CondCodes
AVR specific condition codes.
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo...
virtual 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...
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.
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...
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned TargetFlags=0)
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...
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned TargetFlags=0)
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...
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...
amdgpu Simplify well known AMD library false FunctionCallee Callee
Select(COND, TRUEVAL, FALSEVAL).
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.
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.
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.
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.
unsigned AllocateStack(unsigned Size, unsigned Alignment)
AllocateStack - Allocate a chunk of stack space with the specified size and alignment.
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)
unsigned getOpcode() const
SDValue getValue(unsigned R) const
Calling convention used for special AVR rtlib functions which have an "optimized" convention to prese...
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.
Register getReg() const
getReg - Returns the register number.
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.
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.
Used for AVR interrupt routines.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
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)
Wrapper class representing virtual and physical registers.
const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.
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...