60 SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
86 SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
108 assert((LocVT == MVT::f32 || LocVT == MVT::f128
110 "Can't handle non-64 bits locations");
113 unsigned size = (LocVT == MVT::f128) ? 16 : 8;
118 if (LocVT == MVT::i64 &&
Offset < 6*8)
121 else if (LocVT == MVT::f64 &&
Offset < 16*8)
124 else if (LocVT == MVT::f32 &&
Offset < 16*8)
127 else if (LocVT == MVT::f128 &&
Offset < 16*8)
145 if (LocVT == MVT::f32)
161 if (LocVT == MVT::f32 &&
Offset < 16*8) {
168 if (LocVT == MVT::i32 &&
Offset < 6*8) {
170 unsigned Reg = SP::I0 +
Offset/8;
220#include "SparcGenCallingConv.inc"
226 static_assert(SP::I0 + 7 == SP::I7 && SP::O0 + 7 == SP::O7,
228 if (Reg >= SP::I0 && Reg <= SP::I7)
229 return Reg - SP::I0 + SP::O0;
277 for (
unsigned i = 0, realRVLocIdx = 0;
279 ++i, ++realRVLocIdx) {
283 SDValue Arg = OutVals[realRVLocIdx];
311 unsigned RetAddrOffset = 8;
362 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
391 if (i+1 < RVLocs.
size() && RVLocs[i+1].getLocReg() == VA.
getLocReg()) {
447 for (
unsigned i = 0, e = ArgLocs.size(); i != e; ++i, ++InIdx) {
450 if (Ins[InIdx].Flags.isSRet()) {
481 &SP::IntRegsRegClass);
499 else if (VA.
getLocVT() != MVT::i32) {
558 }
else if (VA.
getValVT() == MVT::f128) {
583 SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
586 const MCPhysReg *CurArgReg = ArgRegs+NumAllocated, *ArgRegEnd = ArgRegs+6;
588 if (NumAllocated == 6)
592 ArgOffset = 68+4*NumAllocated;
598 std::vector<SDValue> OutChains;
600 for (; CurArgReg != ArgRegEnd; ++CurArgReg) {
614 if (!OutChains.empty()) {
615 OutChains.push_back(Chain);
637 const unsigned ArgArea = 128;
639 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
716 for (; ArgOffset < 6*8; ArgOffset += 8) {
726 if (!OutChains.
empty())
743 return Call->hasFnAttr(Attribute::ReturnsTwice);
747 CalleeFn = dyn_cast<Function>(
G->getGlobal());
749 dyn_cast<ExternalSymbolSDNode>(Callee)) {
752 const char *CalleeName =
E->getSymbol();
753 CalleeFn = M->getFunction(CalleeName);
766 auto &Outs = CLI.
Outs;
770 if (Caller.getFnAttribute(
"disable-tail-calls").getValueAsString() ==
"true")
776 unsigned StackSizeLimit = Subtarget->
is64Bit() ? 48 : 0;
782 if (!Outs.empty() && Caller.hasStructRetAttr() != Outs[0].Flags.isSRet())
787 for (
auto &Arg : Outs)
788 if (Arg.Flags.isByVal())
822 ArgsSize = (ArgsSize+7) & ~7;
828 for (
unsigned i = 0, e = Outs.
size(); i != e; ++i) {
830 if (!Flags.isByVal())
834 unsigned Size = Flags.getByValSize();
835 Align Alignment = Flags.getNonZeroByValAlign();
842 Chain = DAG.
getMemcpy(Chain, dl, FIPtr, Arg, SizeNode, Alignment,
855 assert(!isTailCall || ArgsSize == 0);
864 bool hasStructRetAttr =
false;
865 unsigned SRetArgSize = 0;
867 for (
unsigned i = 0, realArgIdx = 0, byvalArgIdx = 0, e = ArgLocs.
size();
871 SDValue Arg = OutVals[realArgIdx];
876 if (Flags.isByVal()) {
877 Arg = ByValArgs[byvalArgIdx++];
901 if (Flags.isSRet()) {
913 hasStructRetAttr =
true;
915 assert(Outs[realArgIdx].OrigArgIndex == 0);
1010 if (!MemOpChains.
empty())
1018 for (
unsigned i = 0, e = RegsToPass.
size(); i != e; ++i) {
1019 Register Reg = RegsToPass[i].first;
1022 Chain = DAG.
getCopyToReg(Chain, dl, Reg, RegsToPass[i].second, InGlue);
1043 if (hasStructRetAttr)
1045 for (
unsigned i = 0, e = RegsToPass.
size(); i != e; ++i) {
1046 Register Reg = RegsToPass[i].first;
1056 ?
TRI->getRTCallPreservedMask(CallConv)
1058 assert(Mask &&
"Missing call preserved mask for calling convention");
1083 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
1084 assert(RVLocs[i].isRegLoc() &&
"Can only return in registers!");
1085 if (RVLocs[i].getLocVT() == MVT::v2i32) {
1088 Chain, dl,
toCallerWindow(RVLocs[i++].getLocReg()), MVT::i32, InGlue);
1089 Chain =
Lo.getValue(1);
1090 InGlue =
Lo.getValue(2);
1094 Chain, dl,
toCallerWindow(RVLocs[i].getLocReg()), MVT::i32, InGlue);
1095 Chain =
Hi.getValue(1);
1096 InGlue =
Hi.getValue(2);
1103 RVLocs[i].getValVT(), InGlue)
1118 .
Case(
"i0", SP::I0).
Case(
"i1", SP::I1).
Case(
"i2", SP::I2).
Case(
"i3", SP::I3)
1119 .
Case(
"i4", SP::I4).
Case(
"i5", SP::I5).
Case(
"i6", SP::I6).
Case(
"i7", SP::I7)
1120 .
Case(
"o0", SP::O0).
Case(
"o1", SP::O1).
Case(
"o2", SP::O2).
Case(
"o3", SP::O3)
1121 .
Case(
"o4", SP::O4).
Case(
"o5", SP::O5).
Case(
"o6", SP::O6).
Case(
"o7", SP::O7)
1122 .
Case(
"l0", SP::L0).
Case(
"l1", SP::L1).
Case(
"l2", SP::L2).
Case(
"l3", SP::L3)
1123 .
Case(
"l4", SP::L4).
Case(
"l5", SP::L5).
Case(
"l6", SP::L6).
Case(
"l7", SP::L7)
1124 .
Case(
"g0", SP::G0).
Case(
"g1", SP::G1).
Case(
"g2", SP::G2).
Case(
"g3", SP::G3)
1125 .
Case(
"g4", SP::G4).
Case(
"g5", SP::G5).
Case(
"g6", SP::G6).
Case(
"g7", SP::G7)
1144 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
1149 if (!VA.
isRegLoc() || (ValTy != MVT::f64 && ValTy != MVT::f128))
1157 Register firstReg = (ValTy == MVT::f64) ? SP::D0 : SP::Q0;
1158 unsigned argSize = (ValTy == MVT::f64) ? 8 : 16;
1160 assert(
Offset < 16*8 &&
"Offset out of range, bad register enum?");
1164 unsigned IReg = SP::I0 +
Offset/8;
1165 if (ValTy == MVT::f64)
1170 assert(ValTy == MVT::f128 &&
"Unexpected type!");
1206 unsigned StackReserved = 6 * 8u;
1207 unsigned ArgsSize = std::max<unsigned>(StackReserved, CCInfo.
getStackSize());
1210 ArgsSize =
alignTo(ArgsSize, 16);
1234 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
1290 RegsToPass.
push_back(std::make_pair(HiReg, Hi64));
1291 RegsToPass.
push_back(std::make_pair(LoReg, Lo64));
1303 if (i+1 < ArgLocs.
size() && ArgLocs[i+1].isRegLoc() &&
1304 ArgLocs[i+1].getLocReg() == VA.
getLocReg()) {
1316 RegsToPass.
push_back(std::make_pair(Reg, Arg));
1335 if (!MemOpChains.
empty())
1343 for (
unsigned i = 0, e = RegsToPass.
size(); i != e; ++i) {
1345 RegsToPass[i].first, RegsToPass[i].second, InGlue);
1365 for (
unsigned i = 0, e = RegsToPass.
size(); i != e; ++i)
1367 RegsToPass[i].second.getValueType()));
1372 ((hasReturnsTwice) ?
TRI->getRTCallPreservedMask(CLI.
CallConv)
1375 assert(Mask &&
"Missing call preserved mask for calling convention");
1406 if (CLI.
Ins.size() == 1 && CLI.
Ins[0].VT == MVT::f32 && !CLI.
CB)
1407 CLI.
Ins[0].Flags.setInReg();
1412 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
1556 if (!Subtarget->useSoftFloat()) {
1724 if (Subtarget->isV9())
1726 else if (Subtarget->hasLeonCasa())
1759 if (!Subtarget->isV9()) {
1801 if (Subtarget->useSoftMulDiv()) {
1851 if (Subtarget->isV9() && Subtarget->hasHardQuad()) {
1859 if (Subtarget->hasHardQuad()) {
1867 if (Subtarget->isV9()) {
1898 if (Subtarget->
is64Bit() && !Subtarget->useSoftFloat()) {
1916 }
else if (!Subtarget->useSoftFloat()) {
1937 if (Subtarget->fixAllFDIVSQRT()) {
1944 if (Subtarget->hasNoFMULS()) {
1952 if (Subtarget->hasLeonCycleCounter())
1963 return Subtarget->useSoftFloat();
1972 return "SPISD::CMPFCC_V9";
1975 return "SPISD::BPICC";
1977 return "SPISD::BPXCC";
1980 return "SPISD::BRFCC_V9";
1982 return "SPISD::BR_REG";
1987 return "SPISD::SELECT_REG";
2020 const APInt &DemandedElts,
2022 unsigned Depth)
const {
2026 switch (
Op.getOpcode()) {
2053 SPCC = cast<ConstantSDNode>(
LHS.getOperand(2))->getZExtValue();
2065 GA->getValueType(0),
2066 GA->getOffset(), TF);
2070 CP->getAlign(), CP->getOffset(), TF);
2080 ES->getValueType(0), TF);
2088 unsigned HiTF,
unsigned LoTF,
2091 EVT VT =
Op.getValueType();
2217 assert(Mask &&
"Missing call preserved mask for calling convention");
2299 Args.push_back(Entry);
2305 const char *LibFuncName,
2306 unsigned numArgs)
const {
2319 if (
RetTy->isFP128Ty()) {
2324 Entry.Node = RetPtr;
2327 Entry.IsSRet =
true;
2328 Entry.IndirectType =
RetTy;
2330 Entry.IsReturned =
false;
2331 Args.push_back(Entry);
2336 for (
unsigned i = 0, e = numArgs; i != e; ++i) {
2346 if (RetTyABI ==
RetTy)
2349 assert (
RetTy->isFP128Ty() &&
"Unexpected return type!");
2359 unsigned &SPCC,
const SDLoc &
DL,
2362 const char *
LibCall =
nullptr;
2459 if (
Op.getOperand(0).getValueType() == MVT::f64)
2463 if (
Op.getOperand(0).getValueType() == MVT::f32)
2475 if (
Op.getOperand(0).getValueType() != MVT::f128)
2478 if (
Op.getValueType() == MVT::f64)
2481 if (
Op.getValueType() == MVT::f32)
2493 EVT VT =
Op.getValueType();
2494 assert(VT == MVT::i32 || VT == MVT::i64);
2497 if (
Op.getOperand(0).getValueType() == MVT::f128
2500 ? RTLIB::FPTOSINT_F128_I32
2501 : RTLIB::FPTOSINT_F128_I64);
2522 EVT OpVT =
Op.getOperand(0).getValueType();
2523 assert(OpVT == MVT::i32 || (OpVT == MVT::i64));
2525 EVT floatVT = (OpVT == MVT::i32) ? MVT::f32 : MVT::f64;
2528 if (
Op.getValueType() == MVT::f128
2531 ? RTLIB::SINTTOFP_I32_F128
2532 : RTLIB::SINTTOFP_I64_F128);
2543 return DAG.
getNode(opcode, dl,
Op.getValueType(), Tmp);
2550 EVT VT =
Op.getValueType();
2554 if (
Op.getOperand(0).getValueType() != MVT::f128 ||
2558 assert(VT == MVT::i32 || VT == MVT::i64);
2562 ? RTLIB::FPTOUINT_F128_I32
2563 : RTLIB::FPTOUINT_F128_I64),
2571 EVT OpVT =
Op.getOperand(0).getValueType();
2572 assert(OpVT == MVT::i32 || OpVT == MVT::i64);
2576 if (
Op.getValueType() != MVT::f128 || (hasHardQuad && TLI.
isTypeLegal(OpVT)))
2581 ? RTLIB::UINTTOFP_I32_F128
2582 : RTLIB::UINTTOFP_I64_F128),
2595 unsigned Opc, SPCC = ~0U;
2604 if (
LHS.getValueType().isInteger()) {
2608 if (
is64Bit && isV9 &&
LHS.getValueType() == MVT::i64 && RHSC &&
2623 if (!hasHardQuad &&
LHS.getValueType() == MVT::f128) {
2634 return DAG.
getNode(Opc, dl, MVT::Other, Chain, Dest,
2635 DAG.
getConstant(SPCC, dl, MVT::i32), CompareFlag);
2647 unsigned Opc, SPCC = ~0U;
2655 if (
LHS.getValueType().isInteger()) {
2662 EVT ValType = TrueVal.getValueType();
2663 bool IsEligibleType = ValType.isScalarInteger() || ValType == MVT::f32 ||
2664 ValType == MVT::f64 ||
2665 (ValType == MVT::f128 && hasHardQuad);
2666 if (
is64Bit && isV9 &&
LHS.getValueType() == MVT::i64 &&
2673 Opc =
LHS.getValueType() == MVT::i32 ?
2677 if (!hasHardQuad &&
LHS.getValueType() == MVT::f128) {
2688 return DAG.
getNode(Opc, dl, TrueVal.getValueType(), TrueVal, FalseVal,
2689 DAG.
getConstant(SPCC, dl, MVT::i32), CompareFlag);
2707 const Value *SV = cast<SrcValueSDNode>(
Op.getOperand(2))->getValue();
2714 EVT VT =
Node->getValueType(0);
2718 const Value *SV = cast<SrcValueSDNode>(
Node->getOperand(2))->getValue();
2741 cast<ConstantSDNode>(
Op.getOperand(2))->getMaybeAlignValue();
2743 EVT VT =
Size->getValueType(0);
2749 if (Alignment && *Alignment > StackAlign) {
2752 "over-aligned dynamic alloca not supported.");
2757 unsigned regSpillArea;
2787 unsigned SPReg = SP::O6;
2796 SDValue Ops[2] = { NewVal, Chain };
2810 bool AlwaysFlush =
false) {
2814 EVT VT =
Op.getValueType();
2816 unsigned FrameReg = SP::I6;
2827 unsigned Offset = (Subtarget->
is64Bit()) ? (stackBias + 112) : 56;
2844 uint64_t depth =
Op.getConstantOperandVal(0);
2860 EVT VT =
Op.getValueType();
2862 uint64_t depth =
Op.getConstantOperandVal(0);
2905 Lo32 = DAG.
getNode(opcode, dl, MVT::f32, Lo32);
2907 Hi32 = DAG.
getNode(opcode, dl, MVT::f32, Hi32);
2965 if (MemVT == MVT::f128)
3014 if (MemVT == MVT::f128)
3017 if (MemVT == MVT::i64) {
3033 &&
"invalid opcode");
3037 if (
Op.getValueType() == MVT::f64)
3039 if (
Op.getValueType() != MVT::f128)
3055 Lo64 = DAG.
getNode(
Op.getOpcode(), dl, MVT::f64, Lo64);
3060 Hi64 = DAG.
getNode(
Op.getOpcode(), dl, MVT::f64, Hi64);
3076 if (
Op.getValueType() != MVT::i64)
3093 bool hasChain =
false;
3094 unsigned hiOpc =
Op.getOpcode();
3095 switch (
Op.getOpcode()) {
3105 Lo = DAG.
getNode(
Op.getOpcode(), dl, VTs, Src1Lo, Src2Lo,
3108 Lo = DAG.
getNode(
Op.getOpcode(), dl, VTs, Src1Lo, Src2Lo);
3119 SDValue Ops[2] = { Dst, Carry };
3128 unsigned opcode =
Op.getOpcode();
3133 EVT WideVT = MVT::i128;
3137 if (
LHS.getValueType() != VT)
3157 RTLIB::MUL_I128, WideVT,
3158 Args, CallOptions, dl).first;
3160 std::tie(BottomHalf, TopHalf) = DAG.
SplitScalar(MulResult, dl, VT, VT);
3172 assert(MulResult->
use_empty() &&
"Illegally typed node still in use!");
3174 SDValue Ops[2] = { BottomHalf, TopHalf } ;
3190 unsigned IntNo = cast<ConstantSDNode>(
Op.getOperand(0))->getZExtValue();
3194 case Intrinsic::thread_pointer: {
3204 bool hasHardQuad = Subtarget->hasHardQuad();
3205 bool isV9 = Subtarget->isV9();
3208 switch (
Op.getOpcode()) {
3267 APInt V =
C->getValueAPF().bitcastToAPInt();
3280 if (isa<ConstantFPSDNode>(Src) &&
N->getSimpleValueType(0) == MVT::v2i32 &&
3281 Src.getSimpleValueType() == MVT::f64)
3289 switch (
N->getOpcode()) {
3301 switch (
MI.getOpcode()) {
3303 case SP::SELECT_CC_Int_ICC:
3304 case SP::SELECT_CC_FP_ICC:
3305 case SP::SELECT_CC_DFP_ICC:
3306 case SP::SELECT_CC_QFP_ICC:
3307 if (Subtarget->isV9())
3310 case SP::SELECT_CC_Int_XCC:
3311 case SP::SELECT_CC_FP_XCC:
3312 case SP::SELECT_CC_DFP_XCC:
3313 case SP::SELECT_CC_QFP_XCC:
3315 case SP::SELECT_CC_Int_FCC:
3316 case SP::SELECT_CC_FP_FCC:
3317 case SP::SELECT_CC_DFP_FCC:
3318 case SP::SELECT_CC_QFP_FCC:
3319 if (Subtarget->isV9())
3327 unsigned BROpcode)
const {
3350 F->insert(It, IfFalseMBB);
3351 F->insert(It, SinkMBB);
3371 MI.getOperand(0).getReg())
3377 MI.eraseFromParent();
3389 if (Constraint.
size() == 1) {
3390 switch (Constraint[0]) {
3406 const char *constraint)
const {
3408 Value *CallOperandVal =
info.CallOperandVal;
3411 if (!CallOperandVal)
3415 switch (*constraint) {
3421 if (isInt<13>(
C->getSExtValue()))
3433 std::string &Constraint,
3434 std::vector<SDValue> &Ops,
3439 if (Constraint.length() > 1)
3442 char ConstraintLetter = Constraint[0];
3443 switch (ConstraintLetter) {
3447 if (isInt<13>(
C->getSExtValue())) {
3456 if (Result.getNode()) {
3457 Ops.push_back(Result);
3463std::pair<unsigned, const TargetRegisterClass *>
3467 if (Constraint.
empty())
3468 return std::make_pair(0U,
nullptr);
3470 if (Constraint.
size() == 1) {
3471 switch (Constraint[0]) {
3473 if (VT == MVT::v2i32)
3474 return std::make_pair(0U, &SP::IntPairRegClass);
3475 else if (Subtarget->
is64Bit())
3476 return std::make_pair(0U, &SP::I64RegsRegClass);
3478 return std::make_pair(0U, &SP::IntRegsRegClass);
3480 if (VT == MVT::f32 || VT == MVT::i32)
3481 return std::make_pair(0U, &SP::FPRegsRegClass);
3482 else if (VT == MVT::f64 || VT == MVT::i64)
3483 return std::make_pair(0U, &SP::LowDFPRegsRegClass);
3484 else if (VT == MVT::f128)
3485 return std::make_pair(0U, &SP::LowQFPRegsRegClass);
3487 return std::make_pair(0U,
nullptr);
3489 if (VT == MVT::f32 || VT == MVT::i32)
3490 return std::make_pair(0U, &SP::FPRegsRegClass);
3491 else if (VT == MVT::f64 || VT == MVT::i64 )
3492 return std::make_pair(0U, &SP::DFPRegsRegClass);
3493 else if (VT == MVT::f128)
3494 return std::make_pair(0U, &SP::QFPRegsRegClass);
3496 return std::make_pair(0U,
nullptr);
3500 if (Constraint.
front() !=
'{')
3501 return std::make_pair(0U,
nullptr);
3503 assert(Constraint.
back() ==
'}' &&
"Not a brace enclosed constraint?");
3506 return std::make_pair(0U,
nullptr);
3508 unsigned long long RegNo;
3517 return std::make_pair(0U,
nullptr);
3518 const char RegTypes[] = {
'g',
'o',
'l',
'i'};
3519 char RegType = RegTypes[RegNo / 8];
3520 char RegIndex =
'0' + (RegNo % 8);
3521 char Tmp[] = {
'{', RegType, RegIndex,
'}', 0};
3526 if (VT != MVT::f32 && VT != MVT::Other &&
RegName[0] ==
'f' &&
3528 if (VT == MVT::f64 && (RegNo % 2 == 0)) {
3531 }
else if (VT == MVT::f128 && (RegNo % 4 == 0)) {
3535 return std::make_pair(0U,
nullptr);
3541 if (!ResultPair.second)
3542 return std::make_pair(0U,
nullptr);
3545 if (Subtarget->
is64Bit() && VT == MVT::i64) {
3546 assert(ResultPair.second == &SP::IntRegsRegClass &&
3547 "Unexpected register class");
3548 return std::make_pair(ResultPair.first, &SP::I64RegsRegClass);
3568 switch (
N->getOpcode()) {
3570 llvm_unreachable(
"Do not know how to custom type legalize this operation!");
3575 if (
N->getOperand(0).getValueType() != MVT::f128
3576 ||
N->getValueType(0) != MVT::i64)
3579 ? RTLIB::FPTOSINT_F128_I64
3580 : RTLIB::FPTOUINT_F128_I64);
3588 assert(Subtarget->hasLeonCycleCounter());
3594 Results.push_back(
N->getOperand(0));
3600 if (
N->getValueType(0) != MVT::f128
3601 ||
N->getOperand(0).getValueType() != MVT::i64)
3605 ? RTLIB::SINTTOFP_I64_F128
3606 : RTLIB::UINTTOFP_I64_F128);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG)
static SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *Subtarget)
Function Alias Analysis Results
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static bool isSigned(unsigned int Opcode)
const HexagonInstrInfo * TII
static LPCC::CondCode IntCondCCodeToICC(SDValue CC, const SDLoc &DL, SDValue &RHS, SelectionDAG &DAG)
unsigned const TargetRegisterInfo * TRI
Module.h This file contains the declarations for the Module class.
const char LLVMTargetMachineRef TM
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static SDValue LowerFP_TO_UINT(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad)
static bool CC_Sparc_Assign_Ret_Split_64(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
static SDValue LowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad)
static bool CC_Sparc_Assign_Split_64(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
static SDValue getFRAMEADDR(uint64_t depth, SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget, bool AlwaysFlush=false)
static unsigned toCallerWindow(unsigned Reg)
static SDValue LowerF128Store(SDValue Op, SelectionDAG &DAG)
static SPCC::CondCodes intCondCCodeToRcond(ISD::CondCode CC)
intCondCCodeToRcond - Convert a DAG integer condition code to a SPARC rcond condition.
static SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG)
static void fixupVariableFloatArgs(SmallVectorImpl< CCValAssign > &ArgLocs, ArrayRef< ISD::OutputArg > Outs)
static SDValue LowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad)
static SPCC::CondCodes FPCondCCodeToFCC(ISD::CondCode CC)
FPCondCCodeToFCC - Convert a DAG floatingp oint condition code to a SPARC FCC condition.
static SDValue getFLUSHW(SDValue Op, SelectionDAG &DAG)
static bool hasReturnsTwiceAttr(SelectionDAG &DAG, SDValue Callee, const CallBase *Call)
static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
static SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
static SDValue LowerUMULO_SMULO(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI)
static SDValue LowerF128_FPROUND(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI)
static SDValue LowerF64Op(SDValue SrcReg64, const SDLoc &dl, SelectionDAG &DAG, unsigned opcode)
static bool RetCC_Sparc64_Full(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
static SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad, bool isV9, bool is64Bit)
static SDValue LowerATOMIC_LOAD_STORE(SDValue Op, SelectionDAG &DAG)
static SDValue LowerADDC_ADDE_SUBC_SUBE(SDValue Op, SelectionDAG &DAG)
static bool RetCC_Sparc64_Half(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
static SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad, bool isV9, bool is64Bit)
static SDValue LowerF128_FPEXTEND(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI)
static SDValue LowerFNEGorFABS(SDValue Op, SelectionDAG &DAG, bool isV9)
static SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG)
static bool CC_Sparc64_Half(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
static bool CC_Sparc64_Full(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
static bool CC_Sparc_Assign_SRet(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
static bool Analyze_CC_Sparc64_Half(bool IsReturn, unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
static SDValue LowerF128Load(SDValue Op, SelectionDAG &DAG)
static SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, const SparcSubtarget *Subtarget)
static void LookThroughSetCC(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, unsigned &SPCC)
static bool Analyze_CC_Sparc64_Full(bool IsReturn, unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
static SDValue LowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad)
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static bool is64Bit(const char *name)
Class for arbitrary precision integers.
This class represents an incoming formal argument to a Function.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
an instruction that atomically reads a memory location, combines it with another value,...
BinOp getOperation() const
LLVM Basic Block Representation.
CCState - This class holds information needed while lowering arguments and return values.
unsigned getFirstUnallocated(ArrayRef< MCPhysReg > Regs) const
getFirstUnallocated - Return the index of the first unallocated register in the set,...
void AnalyzeCallResult(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeCallResult - Analyze the return values of a call, incorporating info about the passed values i...
MCRegister AllocateReg(MCPhysReg Reg)
AllocateReg - Attempt to allocate one register.
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 ...
void AnalyzeReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values i...
int64_t AllocateStack(unsigned Size, Align Alignment)
AllocateStack - Allocate a chunk of stack space with the specified size and alignment.
void AnalyzeCallOperands(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeCallOperands - Analyze the outgoing arguments to a call, incorporating info about the passed v...
uint64_t getStackSize() const
Returns the size of the currently allocated portion of the stack.
void AnalyzeFormalArguments(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals in...
void addLoc(const CCValAssign &V)
CCValAssign - Represent assignment of one arg/retval to a location.
Register getLocReg() const
LocInfo getLocInfo() const
static CCValAssign getMem(unsigned ValNo, MVT ValVT, int64_t Offset, MVT LocVT, LocInfo HTP, bool IsCustom=false)
static CCValAssign getReg(unsigned ValNo, MVT ValVT, unsigned RegNo, MVT LocVT, LocInfo HTP, bool IsCustom=false)
static CCValAssign getCustomReg(unsigned ValNo, MVT ValVT, unsigned RegNo, MVT LocVT, LocInfo HTP)
int64_t getLocMemOffset() const
unsigned getValNo() const
static CCValAssign getCustomMem(unsigned ValNo, MVT ValVT, int64_t Offset, MVT LocVT, LocInfo HTP)
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
This is the shared class of boolean and integer constants.
This class represents an Operation in the Expression.
uint64_t getNumOperands() const
A parsed version of the target data layout string in and methods for querying it.
bool isLittleEndian() const
Layout endianness...
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
bool hasStructRetAttr() const
Determine if the function returns a structure through first or second pointer argument.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
const GlobalValue * getGlobal() const
Module * getParent()
Get the module that this global value is contained inside of...
This is an important class for using LLVM in a threaded context.
This class is used to represent ISD::LOAD nodes.
const SDValue & getBasePtr() const
const SDValue & getOffset() const
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
static auto integer_fixedlen_vector_valuetypes()
static auto integer_valuetypes()
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
static MVT getIntegerVT(unsigned BitWidth)
static auto fp_valuetypes()
void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
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 '...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
int CreateStackObject(uint64_t Size, Align Alignment, bool isSpillSlot, const AllocaInst *Alloca=nullptr, uint8_t ID=0)
Create a new statically sized stack object, returning a nonnegative identifier to represent it.
void setFrameAddressIsTaken(bool T)
void setHasTailCall(bool V=true)
void setReturnAddressIsTaken(bool s)
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Function & getFunction()
Return the LLVM function that this machine code represents.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Register addLiveIn(MCRegister PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
Representation of each machine instruction.
Flags getFlags() const
Return the raw flags of the source value,.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
void addLiveIn(MCRegister Reg, Register vreg=Register())
addLiveIn - Add the specified register as a live-in.
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
Align getOriginalAlign() const
Returns alignment and volatility of the memory access.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
const MachinePointerInfo & getPointerInfo() const
const SDValue & getChain() const
EVT getMemoryVT() const
Return the type of the in-memory value.
A Module instance is used to store all the information related to an LLVM module.
static PointerType * getUnqual(Type *ElementType)
This constructs a pointer to an object of the specified type in the default address space (address sp...
Wrapper class representing virtual and physical registers.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
bool use_empty() const
Return true if there are no uses of this node.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getValue(unsigned R) const
EVT getValueType() const
Return the ValueType of the referenced return value.
const SDValue & getOperand(unsigned i) const
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL,