23#include "llvm/IR/IntrinsicsAMDGPU.h"
24#include "llvm/IR/IntrinsicsR600.h"
29#include "R600GenCallingConv.inc"
34 Gen(STI.getGeneration()) {
107 {MVT::f32, MVT::v2f32, MVT::v3f32, MVT::v4f32, MVT::v5f32,
108 MVT::v6f32, MVT::v7f32, MVT::v8f32, MVT::v16f32},
125 if (Subtarget->hasCARRY())
128 if (Subtarget->hasBORROW())
132 if (!Subtarget->hasBFE())
137 if (!Subtarget->hasBFE())
141 if (!Subtarget->hasBFE())
153 {MVT::v2i32, MVT::v2f32, MVT::v4i32, MVT::v4f32},
Custom);
156 {MVT::v2i32, MVT::v2f32, MVT::v4i32, MVT::v4f32},
Custom);
163 if (!Subtarget->hasFMA())
169 if (!Subtarget->hasBFI())
173 if (!Subtarget->hasBCNT(32))
176 if (!Subtarget->hasBCNT(64))
179 if (Subtarget->hasFFBH())
182 if (Subtarget->hasFFBL())
187 if (Subtarget->hasBFE())
208 if (std::next(
I) ==
I->getParent()->end())
210 return std::next(
I)->getOpcode() == R600::RETURN;
221 switch (
MI.getOpcode()) {
225 if (
TII->isLDSRetInstr(
MI.getOpcode())) {
226 int DstIdx =
TII->getOperandIdx(
MI.getOpcode(), R600::OpName::dst);
231 if (!MRI.
use_empty(
MI.getOperand(DstIdx).getReg()) ||
232 MI.getOpcode() == R600::LDS_CMPST_RET)
244 case R600::FABS_R600: {
246 *BB,
I, R600::MOV,
MI.getOperand(0).getReg(),
247 MI.getOperand(1).getReg());
252 case R600::FNEG_R600: {
254 *BB,
I, R600::MOV,
MI.getOperand(0).getReg(),
255 MI.getOperand(1).getReg());
260 case R600::MASK_WRITE: {
261 Register maskedRegister =
MI.getOperand(0).getReg();
268 case R600::MOV_IMM_F32:
269 TII->buildMovImm(*BB,
I,
MI.getOperand(0).getReg(),
MI.getOperand(1)
276 case R600::MOV_IMM_I32:
277 TII->buildMovImm(*BB,
I,
MI.getOperand(0).getReg(),
278 MI.getOperand(1).getImm());
281 case R600::MOV_IMM_GLOBAL_ADDR: {
283 auto MIB =
TII->buildDefaultInstruction(
284 *BB,
MI, R600::MOV,
MI.getOperand(0).getReg(), R600::ALU_LITERAL_X);
285 int Idx =
TII->getOperandIdx(*MIB, R600::OpName::literal);
293 case R600::CONST_COPY: {
295 *BB,
MI, R600::MOV,
MI.getOperand(0).getReg(), R600::ALU_CONST);
296 TII->setImmOperand(*NewMI, R600::OpName::src0_sel,
297 MI.getOperand(1).getImm());
301 case R600::RAT_WRITE_CACHELESS_32_eg:
302 case R600::RAT_WRITE_CACHELESS_64_eg:
303 case R600::RAT_WRITE_CACHELESS_128_eg:
305 .
add(
MI.getOperand(0))
306 .
add(
MI.getOperand(1))
310 case R600::RAT_STORE_TYPED_eg:
312 .
add(
MI.getOperand(0))
313 .
add(
MI.getOperand(1))
314 .
add(
MI.getOperand(2))
320 .
add(
MI.getOperand(0));
323 case R600::BRANCH_COND_f32: {
327 .
add(
MI.getOperand(1))
332 .
add(
MI.getOperand(0))
337 case R600::BRANCH_COND_i32: {
341 .
add(
MI.getOperand(1))
342 .
addImm(R600::PRED_SETNE_INT)
346 .
add(
MI.getOperand(0))
351 case R600::EG_ExportSwz:
352 case R600::R600_ExportSwz: {
354 bool isLastInstructionOfItsType =
true;
355 unsigned InstExportType =
MI.getOperand(1).getImm();
357 EndBlock = BB->
end(); NextExportInst != EndBlock;
358 NextExportInst = std::next(NextExportInst)) {
359 if (NextExportInst->getOpcode() == R600::EG_ExportSwz ||
360 NextExportInst->getOpcode() == R600::R600_ExportSwz) {
361 unsigned CurrentInstExportType = NextExportInst->getOperand(1)
363 if (CurrentInstExportType == InstExportType) {
364 isLastInstructionOfItsType =
false;
370 if (!EOP && !isLastInstructionOfItsType)
372 unsigned CfInst = (
MI.getOpcode() == R600::EG_ExportSwz) ? 84 : 40;
374 .
add(
MI.getOperand(0))
375 .
add(
MI.getOperand(1))
376 .
add(
MI.getOperand(2))
377 .
add(
MI.getOperand(3))
378 .
add(
MI.getOperand(4))
379 .
add(
MI.getOperand(5))
380 .
add(
MI.getOperand(6))
390 MI.eraseFromParent();
401 switch (
Op.getOpcode()) {
416 assert((!Result.getNode() ||
417 Result.getNode()->getNumValues() == 2) &&
418 "Load should return a value and a chain");
426 return lowerADDRSPACECAST(
Op, DAG);
429 unsigned IntrinsicID =
Op.getConstantOperandVal(1);
430 switch (IntrinsicID) {
431 case Intrinsic::r600_store_swizzle: {
453 unsigned IntrinsicID =
Op.getConstantOperandVal(0);
454 EVT VT =
Op.getValueType();
456 switch (IntrinsicID) {
457 case Intrinsic::r600_tex:
458 case Intrinsic::r600_texc: {
460 switch (IntrinsicID) {
461 case Intrinsic::r600_tex:
464 case Intrinsic::r600_texc:
494 case Intrinsic::r600_dot4: {
516 case Intrinsic::r600_implicitarg_ptr: {
521 case Intrinsic::r600_read_ngroups_x:
522 return LowerImplicitParameter(DAG, VT,
DL, 0);
523 case Intrinsic::r600_read_ngroups_y:
524 return LowerImplicitParameter(DAG, VT,
DL, 1);
525 case Intrinsic::r600_read_ngroups_z:
526 return LowerImplicitParameter(DAG, VT,
DL, 2);
527 case Intrinsic::r600_read_global_size_x:
528 return LowerImplicitParameter(DAG, VT,
DL, 3);
529 case Intrinsic::r600_read_global_size_y:
530 return LowerImplicitParameter(DAG, VT,
DL, 4);
531 case Intrinsic::r600_read_global_size_z:
532 return LowerImplicitParameter(DAG, VT,
DL, 5);
533 case Intrinsic::r600_read_local_size_x:
534 return LowerImplicitParameter(DAG, VT,
DL, 6);
535 case Intrinsic::r600_read_local_size_y:
536 return LowerImplicitParameter(DAG, VT,
DL, 7);
537 case Intrinsic::r600_read_local_size_z:
538 return LowerImplicitParameter(DAG, VT,
DL, 8);
540 case Intrinsic::r600_read_tgid_x:
541 case Intrinsic::amdgcn_workgroup_id_x:
544 case Intrinsic::r600_read_tgid_y:
545 case Intrinsic::amdgcn_workgroup_id_y:
548 case Intrinsic::r600_read_tgid_z:
549 case Intrinsic::amdgcn_workgroup_id_z:
552 case Intrinsic::r600_read_tidig_x:
553 case Intrinsic::amdgcn_workitem_id_x:
556 case Intrinsic::r600_read_tidig_y:
557 case Intrinsic::amdgcn_workitem_id_y:
560 case Intrinsic::r600_read_tidig_z:
561 case Intrinsic::amdgcn_workitem_id_z:
565 case Intrinsic::r600_recipsqrt_ieee:
566 return DAG.
getNode(AMDGPUISD::RSQ,
DL, VT,
Op.getOperand(1));
568 case Intrinsic::r600_recipsqrt_clamped:
569 return DAG.
getNode(AMDGPUISD::RSQ_CLAMP,
DL, VT,
Op.getOperand(1));
584 switch (
N->getOpcode()) {
589 if (
N->getValueType(0) == MVT::i1) {
590 Results.push_back(lowerFP_TO_UINT(
N->getOperand(0), DAG));
598 if (
N->getValueType(0) == MVT::i1) {
599 Results.push_back(lowerFP_TO_SINT(
N->getOperand(0), DAG));
667 return vectorToVerticalVector(DAG, Insert);
678 const GlobalValue *GV = GSD->
getGlobal();
682 return DAG.
getNode(AMDGPUISD::CONST_DATA_PTR, SDLoc(GSD), ConstPtrVT, GA);
688 EVT VT =
Op.getValueType();
699 switch (
Op.getOpcode()) {
701 TrigNode = AMDGPUISD::COS_HW;
704 TrigNode = AMDGPUISD::SIN_HW;
727 unsigned mainop,
unsigned ovf)
const {
729 EVT VT =
Op.getValueType();
766 unsigned DwordOffset)
const {
767 unsigned ByteOffset = DwordOffset * 4;
779bool R600TargetLowering::isZero(
SDValue Op)
const {
781 return Cst->isZero();
783 return CstFP->isZero();
787bool R600TargetLowering::isHWTrueValue(
SDValue Op)
const {
794bool R600TargetLowering::isHWFalseValue(
SDValue Op)
const {
796 return CFP->getValueAPF().isZero();
803 EVT VT =
Op.getValueType();
812 if (VT == MVT::f32) {
820 EVT CompareVT =
LHS.getValueType();
834 if (isHWTrueValue(False) && isHWFalseValue(True)) {
850 if (isHWTrueValue(True) && isHWFalseValue(False) &&
851 (CompareVT == VT || VT == MVT::i32)) {
889 if (CompareVT != VT) {
921 if (CompareVT == MVT::f32) {
924 }
else if (CompareVT == MVT::i32) {
945 EVT VT =
Op.getValueType();
984void R600TargetLowering::getStackAddress(
unsigned StackWidth,
987 unsigned &PtrIncr)
const {
988 switch (StackWidth) {
999 Channel = ElemIdx % 2;
1018 ||
Store->getValue().getValueType() == MVT::i8);
1022 if (
Store->getMemoryVT() == MVT::i8) {
1025 }
else if (
Store->getMemoryVT() == MVT::i16) {
1038 EVT MemVT =
Store->getMemoryVT();
1055 Chain = Dst.getValue(1);
1075 MaskedValue, ShiftAmt);
1082 DstMask = DAG.
getNOT(
DL, DstMask, MVT::i32);
1111 EVT VT =
Value.getValueType();
1127 NewOps[0] = NewChain;
1148 if (TruncatingStore) {
1151 if (MemVT == MVT::i8) {
1154 assert(MemVT == MVT::i16);
1182 Op->getVTList(), Args, MemVT,
1185 if (Ptr->
getOpcode() != AMDGPUISD::DWORDADDR && VT.
bitsGE(MVT::i32)) {
1187 Ptr = DAG.
getNode(AMDGPUISD::DWORDADDR,
DL, PtrVT, DWordAddr);
1202 if (MemVT.
bitsLT(MVT::i32))
1203 return lowerPrivateTruncStore(StoreNode, DAG);
1207 if (Ptr.
getOpcode() != AMDGPUISD::DWORDADDR) {
1208 Ptr = DAG.
getNode(AMDGPUISD::DWORDADDR,
DL, PtrVT, DWordAddr);
1225 return 512 + 4096 * 2;
1227 return 512 + 4096 * 3;
1229 return 512 + 4096 * 4;
1231 return 512 + 4096 * 5;
1233 return 512 + 4096 * 6;
1235 return 512 + 4096 * 7;
1237 return 512 + 4096 * 8;
1239 return 512 + 4096 * 9;
1241 return 512 + 4096 * 10;
1243 return 512 + 4096 * 11;
1245 return 512 + 4096 * 12;
1247 return 512 + 4096 * 13;
1249 return 512 + 4096 * 14;
1251 return 512 + 4096 * 15;
1262 EVT MemVT =
Load->getMemoryVT();
1321 return lowerPrivateExtLoad(
Op, DAG);
1325 EVT VT =
Op.getValueType();
1339 if (ConstantBlock > -1 &&
1376 assert(!MemVT.
isVector() && (MemVT == MVT::i16 || MemVT == MVT::i8));
1383 SDValue MergedValues[2] = { Res, Chain };
1392 if (Ptr.
getOpcode() != AMDGPUISD::DWORDADDR) {
1395 Ptr = DAG.
getNode(AMDGPUISD::DWORDADDR,
DL, MVT::i32, Ptr);
1406 return DAG.
getNode(AMDGPUISD::BRANCH_COND, SDLoc(
Op),
Op.getValueType(),
1413 const R600FrameLowering *TFL = Subtarget->getFrameLowering();
1422 SDLoc(
Op),
Op.getValueType());
1426 bool IsVarArg)
const {
1465 for (
unsigned i = 0, e = Ins.
size(); i < e; ++i) {
1544 unsigned *IsFast)
const {
1548 if (!VT.
isSimple() || VT == MVT::Other)
1558 return VT.
bitsGT(MVT::i32) && Alignment >=
Align(4);
1570 for (
unsigned i = 0; i < 4; i++)
1574 for (
unsigned i = 0; i < 4; i++) {
1579 RemapSwizzle[i] = 7;
1582 RemapSwizzle[i] = 4;
1583 NewBldVec[i] = DAG.
getUNDEF(MVT::f32);
1584 }
else if (
C->isOne()) {
1585 RemapSwizzle[i] = 5;
1586 NewBldVec[i] = DAG.
getUNDEF(MVT::f32);
1593 for (
unsigned j = 0; j < i; j++) {
1594 if (NewBldVec[i] == NewBldVec[j]) {
1596 RemapSwizzle[i] = j;
1614 bool isUnmovable[4] = {
false,
false,
false,
false};
1615 for (
unsigned i = 0; i < 4; i++)
1619 for (
unsigned i = 0; i < 4; i++) {
1620 RemapSwizzle[i] = i;
1624 isUnmovable[Idx] =
true;
1628 for (
unsigned i = 0; i < 4; i++) {
1631 if (isUnmovable[Idx])
1634 std::swap(NewBldVec[Idx], NewBldVec[i]);
1635 std::swap(RemapSwizzle[i], RemapSwizzle[Idx]);
1648 DenseMap<unsigned, unsigned> SwizzleRemap;
1651 for (
unsigned i = 0; i < 4; i++) {
1653 auto It = SwizzleRemap.
find(Idx);
1654 if (It != SwizzleRemap.
end())
1658 SwizzleRemap.
clear();
1660 for (
unsigned i = 0; i < 4; i++) {
1662 auto It = SwizzleRemap.
find(Idx);
1663 if (It != SwizzleRemap.
end())
1688 for (
unsigned i = 0; i < 4; i++) {
1698 EVT NewVT = MVT::v4i32;
1699 unsigned NumElements = 4;
1725 switch (
N->getOpcode()) {
1800 if (Elt <
Ops.size()) {
1803 EVT OpVT =
Ops[0].getValueType();
1821 unsigned Element = Const->getZExtValue();
1830 unsigned Element = Const->getZExtValue();
1858 if (LHS.getOperand(2).getNode() != True.
getNode() ||
1860 RHS.getNode() != False.
getNode()) {
1899 NewArgs[1] = OptimizeSwizzle(
N->getOperand(1), &NewArgs[4], DAG,
DL);
1928 NewArgs[1] = OptimizeSwizzle(
N->getOperand(1), &NewArgs[2], DAG,
DL);
1947bool R600TargetLowering::FoldOperand(
SDNode *ParentNode,
unsigned SrcIdx,
1952 if (!Src.isMachineOpcode())
1955 switch (Src.getMachineOpcode()) {
1956 case R600::FNEG_R600:
1959 Src = Src.getOperand(0);
1962 case R600::FABS_R600:
1968 case R600::CONST_COPY: {
1970 bool HasDst =
TII->getOperandIdx(Opcode, R600::OpName::dst) > -1;
1980 int SrcIndices[] = {
1981 TII->getOperandIdx(Opcode, R600::OpName::src0),
1982 TII->getOperandIdx(Opcode, R600::OpName::src1),
1983 TII->getOperandIdx(Opcode, R600::OpName::src2),
1984 TII->getOperandIdx(Opcode, R600::OpName::src0_X),
1985 TII->getOperandIdx(Opcode, R600::OpName::src0_Y),
1986 TII->getOperandIdx(Opcode, R600::OpName::src0_Z),
1987 TII->getOperandIdx(Opcode, R600::OpName::src0_W),
1988 TII->getOperandIdx(Opcode, R600::OpName::src1_X),
1989 TII->getOperandIdx(Opcode, R600::OpName::src1_Y),
1990 TII->getOperandIdx(Opcode, R600::OpName::src1_Z),
1991 TII->getOperandIdx(Opcode, R600::OpName::src1_W)
1993 std::vector<unsigned> Consts;
1994 for (
int OtherSrcIdx : SrcIndices) {
1995 int OtherSelIdx =
TII->getSelIdx(Opcode, OtherSrcIdx);
1996 if (OtherSrcIdx < 0 || OtherSelIdx < 0)
2002 if (RegisterSDNode *
Reg =
2004 if (
Reg->getReg() == R600::ALU_CONST) {
2012 if (!
TII->fitsConstReadLimitations(Consts)) {
2020 case R600::MOV_IMM_GLOBAL_ADDR:
2022 if (
Imm->getAsZExtVal())
2024 Imm = Src.getOperand(0);
2025 Src = DAG.
getRegister(R600::ALU_LITERAL_X, MVT::i32);
2027 case R600::MOV_IMM_I32:
2028 case R600::MOV_IMM_F32: {
2029 unsigned ImmReg = R600::ALU_LITERAL_X;
2030 uint64_t ImmValue = 0;
2032 if (Src.getMachineOpcode() == R600::MOV_IMM_F32) {
2035 if (FloatValue == 0.0) {
2036 ImmReg = R600::ZERO;
2037 }
else if (FloatValue == 0.5) {
2038 ImmReg = R600::HALF;
2039 }
else if (FloatValue == 1.0) {
2045 uint64_t
Value = Src.getConstantOperandVal(0);
2047 ImmReg = R600::ZERO;
2048 }
else if (
Value == 1) {
2049 ImmReg = R600::ONE_INT;
2058 if (ImmReg == R600::ALU_LITERAL_X) {
2062 if (
C->getZExtValue())
2077 const R600InstrInfo *
TII = Subtarget->getInstrInfo();
2078 if (!
Node->isMachineOpcode())
2081 unsigned Opcode =
Node->getMachineOpcode();
2084 std::vector<SDValue>
Ops(
Node->op_begin(),
Node->op_end());
2086 if (Opcode == R600::DOT_4) {
2087 int OperandIdx[] = {
2088 TII->getOperandIdx(Opcode, R600::OpName::src0_X),
2089 TII->getOperandIdx(Opcode, R600::OpName::src0_Y),
2090 TII->getOperandIdx(Opcode, R600::OpName::src0_Z),
2091 TII->getOperandIdx(Opcode, R600::OpName::src0_W),
2092 TII->getOperandIdx(Opcode, R600::OpName::src1_X),
2093 TII->getOperandIdx(Opcode, R600::OpName::src1_Y),
2094 TII->getOperandIdx(Opcode, R600::OpName::src1_Z),
2095 TII->getOperandIdx(Opcode, R600::OpName::src1_W)
2098 TII->getOperandIdx(Opcode, R600::OpName::src0_neg_X),
2099 TII->getOperandIdx(Opcode, R600::OpName::src0_neg_Y),
2100 TII->getOperandIdx(Opcode, R600::OpName::src0_neg_Z),
2101 TII->getOperandIdx(Opcode, R600::OpName::src0_neg_W),
2102 TII->getOperandIdx(Opcode, R600::OpName::src1_neg_X),
2103 TII->getOperandIdx(Opcode, R600::OpName::src1_neg_Y),
2104 TII->getOperandIdx(Opcode, R600::OpName::src1_neg_Z),
2105 TII->getOperandIdx(Opcode, R600::OpName::src1_neg_W)
2108 TII->getOperandIdx(Opcode, R600::OpName::src0_abs_X),
2109 TII->getOperandIdx(Opcode, R600::OpName::src0_abs_Y),
2110 TII->getOperandIdx(Opcode, R600::OpName::src0_abs_Z),
2111 TII->getOperandIdx(Opcode, R600::OpName::src0_abs_W),
2112 TII->getOperandIdx(Opcode, R600::OpName::src1_abs_X),
2113 TII->getOperandIdx(Opcode, R600::OpName::src1_abs_Y),
2114 TII->getOperandIdx(Opcode, R600::OpName::src1_abs_Z),
2115 TII->getOperandIdx(Opcode, R600::OpName::src1_abs_W)
2117 for (
unsigned i = 0; i < 8; i++) {
2118 if (OperandIdx[i] < 0)
2123 bool HasDst =
TII->getOperandIdx(Opcode, R600::OpName::dst) > -1;
2124 int SelIdx =
TII->getSelIdx(Opcode, OperandIdx[i]);
2127 SDValue &Sel = (SelIdx > -1) ?
Ops[SelIdx] : FakeOp;
2128 if (FoldOperand(Node, i, Src, Neg, Abs, Sel, FakeOp, DAG))
2131 }
else if (Opcode == R600::REG_SEQUENCE) {
2132 for (
unsigned i = 1, e =
Node->getNumOperands(); i < e; i += 2) {
2134 if (FoldOperand(Node, i, Src, FakeOp, FakeOp, FakeOp, FakeOp, DAG))
2138 if (!
TII->hasInstrModifiers(Opcode))
2140 int OperandIdx[] = {
2141 TII->getOperandIdx(Opcode, R600::OpName::src0),
2142 TII->getOperandIdx(Opcode, R600::OpName::src1),
2143 TII->getOperandIdx(Opcode, R600::OpName::src2)
2146 TII->getOperandIdx(Opcode, R600::OpName::src0_neg),
2147 TII->getOperandIdx(Opcode, R600::OpName::src1_neg),
2148 TII->getOperandIdx(Opcode, R600::OpName::src2_neg)
2151 TII->getOperandIdx(Opcode, R600::OpName::src0_abs),
2152 TII->getOperandIdx(Opcode, R600::OpName::src1_abs),
2155 for (
unsigned i = 0; i < 3; i++) {
2156 if (OperandIdx[i] < 0)
2161 SDValue &Abs = (AbsIdx[i] > -1) ?
Ops[AbsIdx[i] - 1] : FakeAbs;
2162 bool HasDst =
TII->getOperandIdx(Opcode, R600::OpName::dst) > -1;
2163 int SelIdx =
TII->getSelIdx(Opcode, OperandIdx[i]);
2164 int ImmIdx =
TII->getOperandIdx(Opcode, R600::OpName::literal);
2169 SDValue &Sel = (SelIdx > -1) ?
Ops[SelIdx] : FakeOp;
2171 if (FoldOperand(Node, i, Src, Neg, Abs, Sel, Imm, DAG))
2180R600TargetLowering::shouldExpandAtomicRMWInIR(
const AtomicRMWInst *RMW)
const {
2197 unsigned ValSize =
DL.getTypeSizeInBits(RMW->
getType());
2198 if (ValSize == 32 || ValSize == 64)
2204 unsigned Size = IntTy->getBitWidth();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Function Alias Analysis Results
Interfaces for producing common pass manager configurations.
const HexagonInstrInfo * TII
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static bool isUndef(const MachineInstr &MI)
Promote Memory to Register
static bool isEOP(MachineBasicBlock::iterator I)
static SDValue ReorganizeVector(SelectionDAG &DAG, SDValue VectorEntry, DenseMap< unsigned, unsigned > &RemapSwizzle)
static int ConstantAddressBlock(unsigned AddressSpace)
static SDValue CompactSwizzlableVector(SelectionDAG &DAG, SDValue VectorEntry, DenseMap< unsigned, unsigned > &RemapSwizzle)
R600 DAG Lowering interface definition.
Provides R600 specific target descriptions.
AMDGPU R600 specific subclass of TargetSubtarget.
The AMDGPU TargetMachine interface definition for hw codegen targets.
const SmallVectorImpl< MachineOperand > & Cond
static Type * getValueType(Value *V, bool LookThroughCmp=false)
Returns the "element type" of the given value/instruction V.
unsigned getStackWidth(const MachineFunction &MF) const
SDValue combineFMinMaxLegacy(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, SDValue True, SDValue False, SDValue CC, DAGCombinerInfo &DCI) const
Generate Min/Max node.
void analyzeFormalArgumentsCompute(CCState &State, const SmallVectorImpl< ISD::InputArg > &Ins) const
The SelectionDAGBuilder will automatically promote function arguments with illegal types.
virtual SDValue LowerGlobalAddress(AMDGPUMachineFunctionInfo *MFI, SDValue Op, SelectionDAG &DAG) const
SDValue LowerSDIVREM(SDValue Op, SelectionDAG &DAG) 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...
uint32_t getImplicitParameterOffset(const MachineFunction &MF, const ImplicitParameter Param) const
Helper function that returns the byte offset of the given type of implicit parameter.
SDValue CreateLiveInRegisterRaw(SelectionDAG &DAG, const TargetRegisterClass *RC, Register Reg, EVT VT) const
AMDGPUTargetLowering(const TargetMachine &TM, const TargetSubtargetInfo &STI, const AMDGPUSubtarget &AMDGPUSTI)
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
This callback is invoked when a node result type is illegal for the target, and the operation was reg...
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
void LowerUDIVREM64(SDValue Op, SelectionDAG &DAG, SmallVectorImpl< SDValue > &Results) const
LLVM_ABI float convertToFloat() const
Converts this APFloat to host float value.
APInt bitcastToAPInt() const
uint64_t getZExtValue() const
Get zero extended value.
unsigned getSrcAddressSpace() const
unsigned getDestAddressSpace() const
an instruction that atomically reads a memory location, combines it with another value,...
@ USubCond
Subtract only if no unsigned overflow.
@ USubSat
*p = usub.sat(old, v) usub.sat matches the behavior of llvm.usub.sat.
@ UIncWrap
Increment one up to a maximum value.
@ FMin
*p = minnum(old, v) minnum matches the behavior of llvm.minnum.
@ FMax
*p = maxnum(old, v) maxnum matches the behavior of llvm.maxnum.
@ UDecWrap
Decrement one until a minimum value or zero.
BinOp getOperation() const
CCState - This class holds information needed while lowering arguments and return values.
LLVM_ABI void AnalyzeFormalArguments(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals in...
CCValAssign - Represent assignment of one arg/retval to a location.
Register getLocReg() const
int64_t getLocMemOffset() const
const APFloat & getValueAPF() const
static LLVM_ABI ConstantPointerNull * get(PointerType *T)
Static factory methods - Return objects of the specified value.
uint64_t getZExtValue() const
A parsed version of the target data layout string in and methods for querying it.
iterator find(const_arg_type_t< KeyT > Val)
const DataLayout & getDataLayout() const
Get the data layout of the module this function belongs to.
LLVM_ABI unsigned getAddressSpace() const
const GlobalValue * getGlobal() const
LLVM_ABI const Function * getFunction() const
Return the function this instruction belongs to.
This is an important class for using LLVM in a threaded context.
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
This class is used to represent ISD::LOAD nodes.
const SDValue & getBasePtr() const
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
static auto integer_valuetypes()
LLVM_ABI DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any debug instructions.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MachineInstrBundleIterator< MachineInstr > iterator
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
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 & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & add(const MachineOperand &MO) const
Representation of each machine instruction.
Flags
Flags values. These may be or'd together.
@ MODereferenceable
The memory access is dereferenceable (i.e., doesn't trap).
@ MONonTemporal
The memory access is non-temporal.
@ MOInvariant
The memory access always returns the same value (or traps).
Flags getFlags() const
Return the raw flags of the source value,.
const Value * getValue() const
Return the base address of the memory access.
MachineOperand class - Representation of each machine instruction operand.
const GlobalValue * getGlobal() const
unsigned getTargetFlags() const
int64_t getOffset() const
Return the offset from the symbol in this operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
LLVM_ABI MachineInstr * getVRegDef(Register Reg) const
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is ...
bool use_empty(Register RegNo) const
use_empty - Return true if there are no instructions using the specified register.
An SDNode that represents everything that will be needed to construct a MachineInstr.
unsigned getAddressSpace() const
Return the address space for the associated pointer.
MachineMemOperand * getMemOperand() const
Return the unique 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.
static LLVM_ABI PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space.
StackOffset getFrameIndexReference(const MachineFunction &MF, int FI, Register &FrameReg) const override
const R600InstrInfo * getInstrInfo() const override
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *BB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
bool canMergeStoresTo(unsigned AS, EVT MemVT, const MachineFunction &MF) const override
Returns if it's reasonable to merge stores to MemVT size.
R600TargetLowering(const TargetMachine &TM, const R600Subtarget &STI)
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &, EVT VT) const override
Return the ValueType of the result of SETCC operations.
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
This callback is invoked when a node result type is illegal for the target, and the operation was reg...
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS, Align Alignment, MachineMemOperand::Flags Flags=MachineMemOperand::MONone, unsigned *IsFast=nullptr) const override
Determine if the target supports unaligned memory accesses.
CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::InputArg > &Ins, const SDLoc &DL, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals) const override
XXX Only kernel functions are supported, so we can assume for now that every function is a kernel fun...
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...
Wrapper class representing virtual and physical registers.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
ArrayRef< SDUse > ops() const
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
uint64_t getAsZExtVal() const
Helper method returns the zero-extended integer value of a ConstantSDNode.
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
const SDValue & getOperand(unsigned Num) const
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
op_iterator op_end() const
op_iterator op_begin() const
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
uint64_t getConstantOperandVal(unsigned i) const
unsigned getOpcode() const
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
LLVM_ABI 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, EVT VT, int64_t offset=0, unsigned TargetFlags=0)
LLVM_ABI SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
LLVM_ABI SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
LLVM_ABI SDValue getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget=false, bool IsOpaque=false)
LLVM_ABI MachineSDNode * getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT)
These are used for target selectors to create a new node with specified return type(s),...
LLVM_ABI SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
LLVM_ABI SDValue getRegister(Register Reg, EVT VT)
LLVM_ABI SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, MaybeAlign Alignment=MaybeAlign(), 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,...
LLVM_ABI SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, Align Alignment, MachineMemOperand::Flags Flags=MachineMemOperand::MOLoad|MachineMemOperand::MOStore, LocationSize Size=LocationSize::precise(0), const AAMDNodes &AAInfo=AAMDNodes())
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
LLVM_ABI SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a bitwise NOT operation as (XOR Val, -1).
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, Register Reg, EVT VT)
LLVM_ABI SDValue getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT)
Return the expression required to zero extend the Op value assuming it was the smaller SrcTy value.
const DataLayout & getDataLayout() const
LLVM_ABI SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
LLVM_ABI SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, Align Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
LLVM_ABI SDValue getSignedConstant(int64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True, SDValue False, ISD::CondCode Cond, SDNodeFlags Flags=SDNodeFlags())
Helper function to make it easier to build SelectCC's if you just have an ISD::CondCode instead of an...
LLVM_ABI SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
LLVM_ABI SDValue getValueType(EVT)
LLVM_ABI SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
LLVM_ABI SDValue getVectorIdxConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
LLVM_ABI void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.getNode() alone.
MachineFunction & getMachineFunction() const
LLVM_ABI SDValue getCondCode(ISD::CondCode Cond)
LLVMContext * getContext() const
LLVM_ABI SDNode * UpdateNodeOperands(SDNode *N, SDValue Op)
Mutate the specified node in-place to have the specified operands.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This class is used to represent ISD::STORE nodes.
const SDValue & getBasePtr() const
const SDValue & getValue() const
bool isTruncatingStore() const
Return true if the op does a truncation before store.
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...
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...
void setHasExtractBitsInsn(bool hasExtractInsn=true)
Tells the code generator that the target has BitExtract instructions.
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type.
bool isCondCodeLegal(ISD::CondCode CC, MVT VT) const
Return true if the specified condition code is legal for a comparison of the specified types on this ...
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...
bool isOperationLegal(unsigned Op, EVT VT) const
Return true if the specified operation is legal on this target.
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
@ ZeroOrNegativeOneBooleanContent
AtomicExpansionKind
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.
void setCondCodeAction(ArrayRef< ISD::CondCode > CCs, MVT VT, LegalizeAction Action)
Indicate that the specified condition code is or isn't supported on the target and indicate what to d...
void setTargetDAGCombine(ArrayRef< ISD::NodeType > NTs)
Targets should invoke this method for each target independent node that they want to provide a custom...
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...
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
SDValue scalarizeVectorStore(StoreSDNode *ST, SelectionDAG &DAG) const
SDValue expandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG) const
Expands an unaligned store to 2 half-size stores for integer values, and possibly more for vectors.
bool expandFP_TO_SINT(SDNode *N, SDValue &Result, SelectionDAG &DAG) const
Expand float(f32) to SINT(i64) conversion.
std::pair< SDValue, SDValue > scalarizeVectorLoad(LoadSDNode *LD, SelectionDAG &DAG) const
Turn load of vector type into a load of the individual elements.
virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
void expandShiftParts(SDNode *N, SDValue &Lo, SDValue &Hi, SelectionDAG &DAG) const
Expand shift-by-parts.
Primary interface to the complete machine description for the target machine.
Type * getType() const
All values are typed, get the type of this value.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ LOCAL_ADDRESS
Address space for local memory.
@ PARAM_I_ADDRESS
Address space for indirect addressable parameter memory (VTX1).
@ CONSTANT_ADDRESS
Address space for constant memory (VTX2).
@ FLAT_ADDRESS
Address space for flat memory.
@ GLOBAL_ADDRESS
Address space for global memory (RAT0, VTX0).
@ PRIVATE_ADDRESS
Address space for private memory.
@ BUILD_VERTICAL_VECTOR
This node is for VLIW targets and it is used to represent a vector that is stored in consecutive regi...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
LLVM_READNONE constexpr bool isShader(CallingConv::ID CC)
constexpr int64_t getNullPointerValue(unsigned AS)
Get the null pointer value for the given address space.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ AMDGPU_CS
Used for Mesa/AMDPAL compute shaders.
@ AMDGPU_VS
Used for Mesa vertex shaders, or AMDPAL last shader stage before rasterization (vertex shader if tess...
@ AMDGPU_KERNEL
Used for AMDGPU code object kernels.
@ AMDGPU_HS
Used for Mesa/AMDPAL hull shaders (= tessellation control shaders).
@ AMDGPU_GS
Used for Mesa/AMDPAL geometry shaders.
@ AMDGPU_PS
Used for Mesa/AMDPAL pixel shaders.
@ Cold
Attempts to make code in the caller as efficient as possible under the assumption that the call is no...
@ SPIR_KERNEL
Used for SPIR kernel functions.
@ Fast
Attempts to make calls as fast as possible (e.g.
@ AMDGPU_ES
Used for AMDPAL shader stage before geometry shader if geometry is in use.
@ AMDGPU_LS
Used for AMDPAL vertex shader if tessellation is in use.
@ C
The default llvm calling convention, compatible with C.
bool isNON_EXTLoad(const SDNode *N)
Returns true if the specified node is a non-extending load.
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
@ MERGE_VALUES
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
@ ATOMIC_STORE
OUTCHAIN = ATOMIC_STORE(INCHAIN, val, ptr) This corresponds to "store atomic" instruction.
@ FMAD
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations.
@ ADD
Simple integer binary arithmetic operators.
@ LOAD
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
@ ANY_EXTEND
ANY_EXTEND - Used for integer types. The high bits are undefined.
@ FMA
FMA - Perform a * b + c with no intermediate rounding step.
@ INTRINSIC_VOID
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
@ FADD
Simple binary floating point operators.
@ SDIVREM
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
@ BITCAST
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
@ SIGN_EXTEND
Conversion operators.
@ FNEG
Perform various unary floating-point operations inspired by libm.
@ BR_CC
BR_CC - Conditional branch.
@ IS_FPCLASS
Performs a check of floating point class property, defined by IEEE-754.
@ SELECT
Select(COND, TRUEVAL, FALSEVAL).
@ ATOMIC_LOAD
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
@ SHL
Shift and rotation operations.
@ EXTRACT_VECTOR_ELT
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
@ SELECT_CC
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
@ SIGN_EXTEND_INREG
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
@ FP_TO_SINT
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
@ AND
Bitwise operators - logical and, logical or, logical xor.
@ INTRINSIC_WO_CHAIN
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
@ INSERT_VECTOR_ELT
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL.
@ CTTZ_ZERO_POISON
Bit counting operators with a poisoned result for zero inputs.
@ FP_ROUND
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
@ ADDRSPACECAST
ADDRSPACECAST - This operator converts between pointers of different address spaces.
@ TRUNCATE
TRUNCATE - Completely drop the high bits.
@ BRCOND
BRCOND - Conditional branch.
@ SHL_PARTS
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations.
@ FCOPYSIGN
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
LLVM_ABI CondCode getSetCCInverse(CondCode Operation, EVT Type)
Return the operation corresponding to !(X op Y), where 'op' is a valid SetCC operation.
LLVM_ABI CondCode getSetCCSwappedOperands(CondCode Operation)
Return the operation corresponding to (Y op X) when given the operation for (X op Y).
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
int32_t getLDSNoRetOp(uint32_t Opcode)
NodeAddr< NodeBase * > Node
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
FunctionAddr VTableAddr Value
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
LLVM_ABI bool isNullConstant(SDValue V)
Returns true if V is a constant integer zero.
@ Kill
The last use of a register.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, Type *OrigTy, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Align commonAlignment(Align A, uint64_t Offset)
Returns the alignment that satisfies both alignments.
@ Custom
The result value requires a custom uniformity check.
LLVM_ABI bool isAllOnesConstant(SDValue V)
Returns true if V is an integer constant with all bits set.
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
This struct is a compact representation of a valid (non-zero power of two) alignment.
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
EVT changeTypeToInteger() const
Return the type converted to an equivalently sized integer or vector with integer element type.
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
uint64_t getScalarSizeInBits() const
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
bool isVector() const
Return true if this is a vector value type.
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
EVT getVectorElementType() const
Given a vector type, return the type of each element.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
bool isInteger() const
Return true if this is an integer or a vector integer type.
This class contains a discriminated union of information about pointers in memory operands,...
bool isBeforeLegalizeOps() const