53 #include "R600GenCallingConv.inc" 221 if (!Subtarget->
hasFMA()) {
231 if (!Subtarget->
hasBFI()) {
257 for (
MVT VT : ScalarIntVTs) {
284 if (std::next(I) == I->getParent()->end())
321 case R600::FABS_R600: {
329 case R600::FNEG_R600: {
337 case R600::MASK_WRITE: {
345 case R600::MOV_IMM_F32:
353 case R600::MOV_IMM_I32:
358 case R600::MOV_IMM_GLOBAL_ADDR: {
368 case R600::CONST_COPY: {
376 case R600::RAT_WRITE_CACHELESS_32_eg:
377 case R600::RAT_WRITE_CACHELESS_64_eg:
378 case R600::RAT_WRITE_CACHELESS_128_eg:
385 case R600::RAT_STORE_TYPED_eg:
398 case R600::BRANCH_COND_f32: {
403 .addImm(R600::PRED_SETNE)
412 case R600::BRANCH_COND_i32: {
417 .addImm(R600::PRED_SETNE_INT)
426 case R600::EG_ExportSwz:
427 case R600::R600_ExportSwz: {
429 bool isLastInstructionOfItsType =
true;
432 EndBlock = BB->
end(); NextExportInst != EndBlock;
433 NextExportInst = std::next(NextExportInst)) {
434 if (NextExportInst->getOpcode() == R600::EG_ExportSwz ||
435 NextExportInst->getOpcode() == R600::R600_ExportSwz) {
436 unsigned CurrentInstExportType = NextExportInst->getOperand(1)
438 if (CurrentInstExportType == InstExportType) {
439 isLastInstructionOfItsType =
false;
445 if (!EOP && !isLastInstructionOfItsType)
447 unsigned CfInst = (MI.
getOpcode() == R600::EG_ExportSwz) ? 84 : 40;
486 case ISD::FSIN:
return LowerTrig(Op, DAG);
493 "Load should return a value and a chain");
502 unsigned IntrinsicID =
503 cast<ConstantSDNode>(Op.
getOperand(1))->getZExtValue();
504 switch (IntrinsicID) {
505 case Intrinsic::r600_store_swizzle: {
527 unsigned IntrinsicID =
528 cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
531 switch (IntrinsicID) {
532 case Intrinsic::r600_tex:
533 case Intrinsic::r600_texc: {
535 switch (IntrinsicID) {
536 case Intrinsic::r600_tex:
539 case Intrinsic::r600_texc:
569 case Intrinsic::r600_dot4: {
591 case Intrinsic::r600_implicitarg_ptr: {
596 case Intrinsic::r600_read_ngroups_x:
597 return LowerImplicitParameter(DAG, VT, DL, 0);
598 case Intrinsic::r600_read_ngroups_y:
599 return LowerImplicitParameter(DAG, VT, DL, 1);
600 case Intrinsic::r600_read_ngroups_z:
601 return LowerImplicitParameter(DAG, VT, DL, 2);
602 case Intrinsic::r600_read_global_size_x:
603 return LowerImplicitParameter(DAG, VT, DL, 3);
604 case Intrinsic::r600_read_global_size_y:
605 return LowerImplicitParameter(DAG, VT, DL, 4);
606 case Intrinsic::r600_read_global_size_z:
607 return LowerImplicitParameter(DAG, VT, DL, 5);
608 case Intrinsic::r600_read_local_size_x:
609 return LowerImplicitParameter(DAG, VT, DL, 6);
610 case Intrinsic::r600_read_local_size_y:
611 return LowerImplicitParameter(DAG, VT, DL, 7);
612 case Intrinsic::r600_read_local_size_z:
613 return LowerImplicitParameter(DAG, VT, DL, 8);
615 case Intrinsic::r600_read_tgid_x:
618 case Intrinsic::r600_read_tgid_y:
621 case Intrinsic::r600_read_tgid_z:
624 case Intrinsic::r600_read_tidig_x:
627 case Intrinsic::r600_read_tidig_y:
630 case Intrinsic::r600_read_tidig_z:
634 case Intrinsic::r600_recipsqrt_ieee:
637 case Intrinsic::r600_recipsqrt_clamped:
714 if (isa<ConstantSDNode>(Index) ||
718 Vector = vectorToVerticalVector(DAG, Vector);
730 if (isa<ConstantSDNode>(Index) ||
734 Vector = vectorToVerticalVector(DAG, Vector);
736 Vector, Value,
Index);
737 return vectorToVerticalVector(DAG, Insert);
864 unsigned mainop,
unsigned ovf)
const {
903 unsigned DwordOffset)
const {
904 unsigned ByteOffset = DwordOffset * 4;
916 bool R600TargetLowering::isZero(
SDValue Op)
const {
918 return Cst->isNullValue();
920 return CstFP->isZero();
926 bool R600TargetLowering::isHWTrueValue(
SDValue Op)
const {
928 return CFP->isExactlyValue(1.0);
933 bool R600TargetLowering::isHWFalseValue(
SDValue Op)
const {
935 return CFP->getValueAPF().isZero();
976 if (isHWTrueValue(False) && isHWFalseValue(True)) {
990 if (isHWTrueValue(True) && isHWFalseValue(False) &&
991 (CompareVT == VT || VT ==
MVT::i32)) {
1029 if (CompareVT != VT) {
1064 }
else if (CompareVT ==
MVT::i32) {
1088 unsigned StackWidth,
1091 switch(StackWidth) {
1109 void R600TargetLowering::getStackAddress(
unsigned StackWidth,
1112 unsigned &PtrIncr)
const {
1113 switch (StackWidth) {
1124 Channel = ElemIdx % 2;
1201 MaskedValue, ShiftAmt);
1255 StoreNode = cast<StoreSDNode>(NewStore);
1327 return lowerPrivateTruncStore(StoreNode, DAG);
1343 switch (AddressSpace) {
1349 return 512 + 4096 * 2;
1351 return 512 + 4096 * 3;
1353 return 512 + 4096 * 4;
1355 return 512 + 4096 * 5;
1357 return 512 + 4096 * 6;
1359 return 512 + 4096 * 7;
1361 return 512 + 4096 * 8;
1363 return 512 + 4096 * 9;
1365 return 512 + 4096 * 10;
1367 return 512 + 4096 * 11;
1369 return 512 + 4096 * 12;
1371 return 512 + 4096 * 13;
1373 return 512 + 4096 * 14;
1375 return 512 + 4096 * 15;
1446 return lowerPrivateExtLoad(Op, DAG);
1462 if (ConstantBlock > -1 &&
1467 isa<ConstantSDNode>(Ptr)) {
1508 SDValue MergedValues[2] = { Res, Chain };
1543 unsigned IgnoredFrameReg;
1551 bool IsVarArg)
const {
1591 for (
unsigned i = 0, e = Ins.
size(); i < e; ++i) {
1602 unsigned Reg = MF.addLiveIn(VA.
getLocReg(), &R600::R600_Reg128RegClass);
1668 bool *IsFast)
const {
1697 for (
unsigned i = 0; i < 4; i++) {
1702 RemapSwizzle[i] = 7;
1705 RemapSwizzle[i] = 4;
1707 }
else if (
C->isExactlyValue(1.0)) {
1708 RemapSwizzle[i] = 5;
1715 for (
unsigned j = 0; j < i; j++) {
1716 if (NewBldVec[i] == NewBldVec[j]) {
1718 RemapSwizzle[i] = j;
1738 bool isUnmovable[4] = {
false,
false,
false,
false };
1739 for (
unsigned i = 0; i < 4; i++) {
1740 RemapSwizzle[i] = i;
1745 isUnmovable[Idx] =
true;
1749 for (
unsigned i = 0; i < 4; i++) {
1753 if (isUnmovable[Idx])
1756 std::swap(NewBldVec[Idx], NewBldVec[i]);
1757 std::swap(RemapSwizzle[i], RemapSwizzle[Idx]);
1768 const SDLoc &DL)
const {
1774 for (
unsigned i = 0; i < 4; i++) {
1775 unsigned Idx = cast<ConstantSDNode>(Swz[i])->getZExtValue();
1776 if (SwizzleRemap.find(Idx) != SwizzleRemap.end())
1780 SwizzleRemap.clear();
1782 for (
unsigned i = 0; i < 4; i++) {
1783 unsigned Idx = cast<ConstantSDNode>(Swz[i])->getZExtValue();
1784 if (SwizzleRemap.find(Idx) != SwizzleRemap.end())
1797 assert (isa<ConstantSDNode>(Ptr));
1809 for (
unsigned i = 0; i < 4; i++) {
1820 unsigned NumElements = 4;
1904 if (!isa<ConstantSDNode>(EltNo))
1906 unsigned Elt = cast<ConstantSDNode>(EltNo)->getZExtValue();
1923 if (Elt < Ops.
size()) {
1926 EVT OpVT = Ops[0].getValueType();
1944 unsigned Element = Const->getZExtValue();
1953 unsigned Element = Const->getZExtValue();
2023 NewArgs[1] = OptimizeSwizzle(N->
getOperand(1), &NewArgs[4], DAG, DL);
2052 NewArgs[1] = OptimizeSwizzle(N->
getOperand(1), &NewArgs[2], DAG, DL);
2060 isa<ConstantSDNode>(Ptr))
2071 bool R600TargetLowering::FoldOperand(
SDNode *ParentNode,
unsigned SrcIdx,
2080 case R600::FNEG_R600:
2086 case R600::FABS_R600:
2092 case R600::CONST_COPY: {
2094 bool HasDst = TII->
getOperandIdx(Opcode, R600::OpName::dst) > -1;
2104 int SrcIndices[] = {
2117 std::vector<unsigned> Consts;
2118 for (
int OtherSrcIdx : SrcIndices) {
2119 int OtherSelIdx = TII->
getSelIdx(Opcode, OtherSrcIdx);
2120 if (OtherSrcIdx < 0 || OtherSelIdx < 0)
2127 dyn_cast<RegisterSDNode>(ParentNode->
getOperand(OtherSrcIdx))) {
2128 if (
Reg->getReg() == R600::ALU_CONST) {
2130 = cast<ConstantSDNode>(ParentNode->
getOperand(OtherSelIdx));
2146 case R600::MOV_IMM_GLOBAL_ADDR:
2148 if (cast<ConstantSDNode>(Imm)->getZExtValue())
2153 case R600::MOV_IMM_I32:
2154 case R600::MOV_IMM_F32: {
2155 unsigned ImmReg = R600::ALU_LITERAL_X;
2156 uint64_t ImmValue = 0;
2161 if (FloatValue == 0.0) {
2162 ImmReg = R600::ZERO;
2163 }
else if (FloatValue == 0.5) {
2164 ImmReg = R600::HALF;
2165 }
else if (FloatValue == 1.0) {
2174 ImmReg = R600::ZERO;
2175 }
else if (Value == 1) {
2176 ImmReg = R600::ONE_INT;
2185 if (ImmReg == R600::ALU_LITERAL_X) {
2214 if (Opcode == R600::DOT_4) {
2215 int OperandIdx[] = {
2245 for (
unsigned i = 0; i < 8; i++) {
2246 if (OperandIdx[i] < 0)
2248 SDValue &Src = Ops[OperandIdx[i] - 1];
2249 SDValue &Neg = Ops[NegIdx[i] - 1];
2250 SDValue &Abs = Ops[AbsIdx[i] - 1];
2251 bool HasDst = TII->
getOperandIdx(Opcode, R600::OpName::dst) > -1;
2252 int SelIdx = TII->
getSelIdx(Opcode, OperandIdx[i]);
2255 SDValue &Sel = (SelIdx > -1) ? Ops[SelIdx] : FakeOp;
2256 if (FoldOperand(Node, i, Src, Neg, Abs, Sel, FakeOp, DAG))
2259 }
else if (Opcode == R600::REG_SEQUENCE) {
2260 for (
unsigned i = 1, e = Node->
getNumOperands(); i < e; i += 2) {
2262 if (FoldOperand(Node, i, Src, FakeOp, FakeOp, FakeOp, FakeOp, DAG))
2268 int OperandIdx[] = {
2283 for (
unsigned i = 0; i < 3; i++) {
2284 if (OperandIdx[i] < 0)
2286 SDValue &Src = Ops[OperandIdx[i] - 1];
2287 SDValue &Neg = Ops[NegIdx[i] - 1];
2289 SDValue &Abs = (AbsIdx[i] > -1) ? Ops[AbsIdx[i] - 1] : FakeAbs;
2290 bool HasDst = TII->
getOperandIdx(Opcode, R600::OpName::dst) > -1;
2291 int SelIdx = TII->
getSelIdx(Opcode, OperandIdx[i]);
2292 int ImmIdx = TII->
getOperandIdx(Opcode, R600::OpName::literal);
2297 SDValue &Sel = (SelIdx > -1) ? Ops[SelIdx] : FakeOp;
2299 if (FoldOperand(Node, i, Src, Neg, Abs, Sel, Imm, DAG))
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...
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
static SDValue CompactSwizzlableVector(SelectionDAG &DAG, SDValue VectorEntry, DenseMap< unsigned, unsigned > &RemapSwizzle)
void push_back(const T &Elt)
const MachineInstrBuilder & add(const MachineOperand &MO) const
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.
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...
const SDValue & getOffset() const
Calling convention used for AMDPAL shader stage before geometry shader if geometry is in use...
const GlobalValue * getGlobal() const
uint64_t getZExtValue() const
Get zero extended value.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
AMDGPU specific subclass of TargetSubtarget.
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
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...
C - The default llvm calling convention, compatible with C.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
BR_CC - Conditional branch.
Compute iterated dominance frontiers using a linear time algorithm.
void analyzeFormalArgumentsCompute(CCState &State, const SmallVectorImpl< ISD::InputArg > &Ins) const
The SelectionDAGBuilder will automatically promote function arguments with illegal types...
Interface definition for R600InstrInfo.
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
SDValue scalarizeVectorStore(StoreSDNode *ST, SelectionDAG &DAG) const
bool canMergeStoresTo(unsigned AS, EVT MemVT, const SelectionDAG &DAG) const override
Returns if it's reasonable to merge stores to MemVT size.
void addFlag(MachineInstr &MI, unsigned Operand, unsigned Flag) const
Add one of the MO_FLAG* flags to the specified Operand.
const SDValue & getBasePtr() const
Carry-setting nodes for multiple precision addition and subtraction.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
unsigned getReg() const
getReg - Returns the register number.
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
const SDValue & getValue() const
SDVTList getVTList() const
static PointerType * getInt32PtrTy(LLVMContext &C, unsigned AS=0)
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space...
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...
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *BB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
float convertToFloat() const
const SDValue & getChain() const
Function Alias Analysis Results
unsigned getAlignment() const
constexpr bool isInt< 16 >(int64_t x)
bool isInteger() const
Return true if this is an integer or a vector integer type.
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.
Address space for local memory.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
bool isCondCodeLegal(ISD::CondCode CC, MVT VT) const
Return true if the specified condition code 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 ...
bool isTruncatingStore() const
Return true if the op does a truncation before store.
unsigned getAddressSpace() const
Return the address space for the associated pointer.
Calling convention used for Mesa/AMDPAL pixel shaders.
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
Address space for constant memory (VTX2)
Pointer to the start of the shader's constant data.
const HexagonInstrInfo * TII
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Shift and rotation operations.
const ConstantFP * getFPImm() const
unsigned getNumOperands() const
Access to explicit operands of the instruction.
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const override
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), MachineInstr opcode, and operands.
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.
op_iterator op_end() const
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
void setCondCodeAction(ISD::CondCode CC, MVT VT, LegalizeAction Action)
Indicate that the specified condition code is or isn't supported on the target and indicate what to d...
unsigned getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
The memory access is dereferenceable (i.e., doesn't trap).
int getSelIdx(unsigned Opcode, unsigned SrcIdx) const
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
void setImmOperand(MachineInstr &MI, unsigned Op, int64_t Imm) const
Helper function for setting instruction flag values.
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.
Interface to describe a layout of a stack frame on an AMDGPU target.
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...
This file implements a class to represent arbitrary precision integral constant values and operations...
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
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...
MachineInstr * getVRegDef(unsigned Reg) const
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is ...
SPIR_KERNEL - Calling convention for SPIR kernel functions.
bool hasInstrModifiers(unsigned Opcode) const
unsigned getScalarSizeInBits() const
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
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...
Simple integer binary arithmetic operators.
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 getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
op_iterator op_begin() const
MachineInstrBuilder buildDefaultInstruction(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned Opcode, unsigned DstReg, unsigned Src0Reg, unsigned Src1Reg=0) const
buildDefaultInstruction - This function returns a MachineInstr with all the instruction modifiers ini...
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
Class to represent pointers.
This class is used to represent ISD::STORE nodes.
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
This node is for VLIW targets and it is used to represent a vector that is stored in consecutive regi...
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...
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
const Value * getValue() const
Return the base address of the memory access.
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
const R600FrameLowering * getFrameLowering() const override
constexpr uint64_t MinAlign(uint64_t A, uint64_t B)
A and B are either alignments or offsets.
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.
bool hasFP32Denormals() const
const SDValue & getBasePtr() const
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
unsigned const MachineRegisterInfo * MRI
static ConstantPointerNull * get(PointerType *T)
Static factory methods - Return objects of the specified value.
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...
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...
Simple binary floating point operators.
void setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
bool isMachineOpcode() const
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
static int ConstantAddressBlock(unsigned AddressSpace)
SDValue LowerSDIVREM(SDValue Op, SelectionDAG &DAG) const
const SDValue & getOperand(unsigned Num) const
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE and DBG_LABEL instructions...
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
Carry-using nodes for multiple precision addition and subtraction.
Calling convention used for AMDPAL vertex shader if tessellation is in use.
virtual SDValue LowerGlobalAddress(AMDGPUMachineFunction *MFI, SDValue Op, SelectionDAG &DAG) const
const SDValue & getOffset() const
This file declares a class to represent arbitrary precision floating point values and provide a varie...
const R600InstrInfo * getInstrInfo() const override
unsigned getMachineOpcode() const
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
int getOperandIdx(const MachineInstr &MI, unsigned Op) const
Get the index of Op in the MachineInstr.
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...
The memory access is non-temporal.
SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, unsigned Align=0, MachineMemOperand::Flags Flags=MachineMemOperand::MOLoad|MachineMemOperand::MOStore, unsigned Size=0)
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
CondCode getSetCCSwappedOperands(CondCode Operation)
Return the operation corresponding to (Y op X) when given the operation for (X op Y)...
bool isOperationLegal(unsigned Op, EVT VT) const
Return true if the specified operation is legal on this target.
Bit counting operators with an undefined result for zero inputs.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
bool isBeforeLegalizeOps() const
This class contains a discriminated union of information about pointers in memory operands...
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
unsigned getNumOperands() const
Return the number of values used by this operation.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
bool fitsConstReadLimitations(const std::vector< MachineInstr *> &) const
An instruction group can only access 2 channel pair (either [XY] or [ZW]) from KCache bank on R700+...
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...
static SDValue ReorganizeVector(SelectionDAG &DAG, SDValue VectorEntry, DenseMap< unsigned, unsigned > &RemapSwizzle)
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...
unsigned getAddressSpace() const
void setHasExtractBitsInsn(bool hasExtractInsn=true)
Tells the code generator that the target has BitExtract instructions.
const APFloat & getValueAPF() const
const R600RegisterInfo * getRegisterInfo() const override
static bool isUndef(ArrayRef< int > Mask)
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 CreateLiveInRegisterRaw(SelectionDAG &DAG, const TargetRegisterClass *RC, unsigned Reg, EVT VT) const
CCState - This class holds information needed while lowering arguments and return values...
SDValue scalarizeVectorLoad(LoadSDNode *LD, SelectionDAG &DAG) const
Turn load of vector type into a load of the individual elements.
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
EVT getVectorElementType() const
Given a vector type, return the type of each element.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
CCValAssign - Represent assignment of one arg/retval to a location.
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
int getLDSNoRetOp(uint16_t Opcode)
BRCOND - Conditional branch.
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...
An SDNode that represents everything that will be needed to construct a MachineInstr.
Promote Memory to Register
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
CondCode getSetCCInverse(CondCode Operation, bool isInteger)
Return the operation corresponding to !(X op Y), where 'op' is a valid SetCC operation.
SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a bitwise NOT operation as (XOR Val, -1).
SDValue combineFMinMaxLegacy(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, SDValue True, SDValue False, SDValue CC, DAGCombinerInfo &DCI) const
Generate Min/Max node.
static mvt_range integer_valuetypes()
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
EVT getMemoryVT() const
Return the type of the in-memory value.
SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
Calling convention used for Mesa/AMDPAL compute shaders.
bool isShader(CallingConv::ID cc)
Select(COND, TRUEVAL, FALSEVAL).
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
Calling convention for AMDGPU code object kernels.
ANY_EXTEND - Used for integer types. The high bits are undefined.
bool use_empty(unsigned RegNo) const
use_empty - Return true if there are no instructions using the specified register.
SDValue expandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG) const
Expands an unaligned store to 2 half-size stores for integer values, and possibly more for vectors...
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
Address space for global memory (RAT0, VTX0).
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
bool isLDSRetInstr(unsigned Opcode) const
bool hasBCNT(unsigned Size) const
amdgpu Simplify well known AMD library false Value Value * Arg
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Provides AMDGPU specific target descriptions.
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Calling convention used for Mesa/AMDPAL geometry shaders.
void LowerUDIVREM64(SDValue Op, SelectionDAG &DAG, SmallVectorImpl< SDValue > &Results) const
bool isVector() const
Return true if this is a vector value type.
Bitwise operators - logical and, logical or, logical xor.
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
R600TargetLowering(const TargetMachine &TM, const R600Subtarget &STI)
R600 DAG Lowering interface definition.
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
Flags getFlags() const
Return the raw flags of the source value,.
The memory access always returns the same value (or traps).
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool isNON_EXTLoad(const SDNode *N)
Returns true if the specified node is a non-extending load.
unsigned getOpcode() const
SDValue getValue(unsigned R) const
LLVM_NODISCARD bool empty() const
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
SDValue getCondCode(ISD::CondCode Cond)
const MachinePointerInfo & getPointerInfo() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT SVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
bool isAllOnesConstant(SDValue V)
Returns true if V is an integer constant with all bits set.
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
LLVM Value Representation.
FMA - Perform a * b + c with no intermediate rounding step.
SDValue getRegister(unsigned Reg, EVT VT)
Calling convention used for Mesa vertex shaders, or AMDPAL last shader stage before rasterization (ve...
Address space for indirect addressible parameter memory (VTX1)
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
bool isNullConstant(SDValue V)
Returns true if V is a constant integer zero.
SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True, SDValue False, ISD::CondCode Cond)
Helper function to make it easier to build SelectCC's if you just have an ISD::CondCode instead of an...
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS, unsigned Align, bool *IsFast) const override
Determine if the target supports unaligned memory accesses.
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.
static bool isEOP(MachineBasicBlock::iterator I)
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.getNode() alone...
Primary interface to the complete machine description for the target machine.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
const APFloat & getValueAPF() const
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations...
SetCC operator - This evaluates to a true value iff the condition is true.
APInt bitcastToAPInt() const
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
const SDValue & getOperand(unsigned i) const
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
unsigned getLocReg() const
uint64_t getZExtValue() const
TRUNCATE - Completely drop the high bits.
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
const MachineOperand & getOperand(unsigned i) const
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &, EVT VT) const override
Return the ValueType of the result of SETCC operations.
FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW, FLOG, FLOG2, FLOG10, FEXP, FEXP2, FCEIL, FTRUNC, FRINT, FNEARBYINT, FROUND, FFLOOR - Perform various unary floating point operations.
Calling convention used for Mesa/AMDPAL hull shaders (= tessellation control shaders).
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
MVT getVectorIdxTy(const DataLayout &) const override
Returns the type to be used for the index operand of: ISD::INSERT_VECTOR_ELT, ISD::EXTRACT_VECTOR_ELT...
LLVMContext * getContext() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
MachineInstr * buildMovImm(MachineBasicBlock &BB, MachineBasicBlock::iterator I, unsigned DstReg, uint64_t Imm) const
unsigned PRIVATE_ADDRESS
Address space for private memory.
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
This class is used to represent ISD::LOAD nodes.
unsigned getStackWidth(const MachineFunction &MF) const
bool expandFP_TO_SINT(SDNode *N, SDValue &Result, SelectionDAG &DAG) const
Expand float(f32) to SINT(i64) conversion.