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);
490 SDValue Result = LowerLOAD(Op, DAG);
493 "Load should return a value and a chain");
502 unsigned IntrinsicID =
503 cast<ConstantSDNode>(Op.
getOperand(1))->getZExtValue();
504 switch (IntrinsicID) {
527 unsigned IntrinsicID =
528 cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
531 switch (IntrinsicID) {
535 switch (IntrinsicID) {
597 return LowerImplicitParameter(DAG, VT, DL, 0);
599 return LowerImplicitParameter(DAG, VT, DL, 1);
601 return LowerImplicitParameter(DAG, VT, DL, 2);
603 return LowerImplicitParameter(DAG, VT, DL, 3);
605 return LowerImplicitParameter(DAG, VT, DL, 4);
607 return LowerImplicitParameter(DAG, VT, DL, 5);
609 return LowerImplicitParameter(DAG, VT, DL, 6);
611 return LowerImplicitParameter(DAG, VT, DL, 7);
613 return LowerImplicitParameter(DAG, VT, DL, 8);
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 {
1690 SDLoc DL(VectorEntry);
1694 for (
unsigned i = 0; i < 4; i++)
1698 for (
unsigned i = 0; i < 4; i++) {
1703 RemapSwizzle[i] = 7;
1706 RemapSwizzle[i] = 4;
1708 }
else if (
C->isExactlyValue(1.0)) {
1709 RemapSwizzle[i] = 5;
1716 for (
unsigned j = 0; j < i; j++) {
1717 if (NewBldVec[i] == NewBldVec[j]) {
1719 RemapSwizzle[i] = j;
1733 SDLoc DL(VectorEntry);
1737 bool isUnmovable[4] = {
false,
false,
false,
false};
1738 for (
unsigned i = 0; i < 4; i++)
1742 for (
unsigned i = 0; i < 4; i++) {
1743 RemapSwizzle[i] = i;
1748 isUnmovable[Idx] =
true;
1752 for (
unsigned i = 0; i < 4; i++) {
1756 if (isUnmovable[Idx])
1759 std::swap(NewBldVec[Idx], NewBldVec[i]);
1760 std::swap(RemapSwizzle[i], RemapSwizzle[Idx]);
1771 const SDLoc &DL)
const {
1776 for (
unsigned i = 0; i < 4; i++) {
1777 unsigned Idx = cast<ConstantSDNode>(Swz[i])->getZExtValue();
1778 if (SwizzleRemap.
find(Idx) != SwizzleRemap.
end())
1782 SwizzleRemap.
clear();
1784 for (
unsigned i = 0; i < 4; i++) {
1785 unsigned Idx = cast<ConstantSDNode>(Swz[i])->getZExtValue();
1786 if (SwizzleRemap.
find(Idx) != SwizzleRemap.
end())
1799 assert (isa<ConstantSDNode>(Ptr));
1811 for (
unsigned i = 0; i < 4; i++) {
1822 unsigned NumElements = 4;
1906 if (!isa<ConstantSDNode>(EltNo))
1908 unsigned Elt = cast<ConstantSDNode>(EltNo)->getZExtValue();
1925 if (Elt < Ops.
size()) {
1928 EVT OpVT = Ops[0].getValueType();
1946 unsigned Element = Const->getZExtValue();
1955 unsigned Element = Const->getZExtValue();
2025 NewArgs[1] = OptimizeSwizzle(N->
getOperand(1), &NewArgs[4], DAG, DL);
2054 NewArgs[1] = OptimizeSwizzle(N->
getOperand(1), &NewArgs[2], DAG, DL);
2062 isa<ConstantSDNode>(Ptr))
2073 bool R600TargetLowering::FoldOperand(
SDNode *ParentNode,
unsigned SrcIdx,
2082 case R600::FNEG_R600:
2088 case R600::FABS_R600:
2094 case R600::CONST_COPY: {
2096 bool HasDst = TII->
getOperandIdx(Opcode, R600::OpName::dst) > -1;
2106 int SrcIndices[] = {
2119 std::vector<unsigned> Consts;
2120 for (
int OtherSrcIdx : SrcIndices) {
2121 int OtherSelIdx = TII->
getSelIdx(Opcode, OtherSrcIdx);
2122 if (OtherSrcIdx < 0 || OtherSelIdx < 0)
2129 dyn_cast<RegisterSDNode>(ParentNode->
getOperand(OtherSrcIdx))) {
2130 if (
Reg->getReg() == R600::ALU_CONST) {
2132 = cast<ConstantSDNode>(ParentNode->
getOperand(OtherSelIdx));
2148 case R600::MOV_IMM_GLOBAL_ADDR:
2150 if (cast<ConstantSDNode>(Imm)->getZExtValue())
2155 case R600::MOV_IMM_I32:
2156 case R600::MOV_IMM_F32: {
2157 unsigned ImmReg = R600::ALU_LITERAL_X;
2158 uint64_t ImmValue = 0;
2163 if (FloatValue == 0.0) {
2164 ImmReg = R600::ZERO;
2165 }
else if (FloatValue == 0.5) {
2166 ImmReg = R600::HALF;
2167 }
else if (FloatValue == 1.0) {
2176 ImmReg = R600::ZERO;
2177 }
else if (Value == 1) {
2178 ImmReg = R600::ONE_INT;
2187 if (ImmReg == R600::ALU_LITERAL_X) {
2216 if (Opcode == R600::DOT_4) {
2217 int OperandIdx[] = {
2247 for (
unsigned i = 0; i < 8; i++) {
2248 if (OperandIdx[i] < 0)
2250 SDValue &Src = Ops[OperandIdx[i] - 1];
2251 SDValue &Neg = Ops[NegIdx[i] - 1];
2252 SDValue &Abs = Ops[AbsIdx[i] - 1];
2253 bool HasDst = TII->
getOperandIdx(Opcode, R600::OpName::dst) > -1;
2254 int SelIdx = TII->
getSelIdx(Opcode, OperandIdx[i]);
2257 SDValue &Sel = (SelIdx > -1) ? Ops[SelIdx] : FakeOp;
2258 if (FoldOperand(Node, i, Src, Neg, Abs, Sel, FakeOp, DAG))
2261 }
else if (Opcode == R600::REG_SEQUENCE) {
2262 for (
unsigned i = 1, e = Node->
getNumOperands(); i < e; i += 2) {
2264 if (FoldOperand(Node, i, Src, FakeOp, FakeOp, FakeOp, FakeOp, DAG))
2270 int OperandIdx[] = {
2285 for (
unsigned i = 0; i < 3; i++) {
2286 if (OperandIdx[i] < 0)
2288 SDValue &Src = Ops[OperandIdx[i] - 1];
2289 SDValue &Neg = Ops[NegIdx[i] - 1];
2291 SDValue &Abs = (AbsIdx[i] > -1) ? Ops[AbsIdx[i] - 1] : FakeAbs;
2292 bool HasDst = TII->
getOperandIdx(Opcode, R600::OpName::dst) > -1;
2293 int SelIdx = TII->
getSelIdx(Opcode, OperandIdx[i]);
2294 int ImmIdx = TII->
getOperandIdx(Opcode, R600::OpName::literal);
2299 SDValue &Sel = (SelIdx > -1) ? Ops[SelIdx] : FakeOp;
2301 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)
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
C - The default llvm calling convention, compatible with C.
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...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
BR_CC - Conditional branch.
This class represents lattice values for constants.
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.
void push_back(const T &Elt)
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
Address space for private memory.
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.
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.
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...
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
Calling convention used for Mesa/AMDPAL geometry shaders.
Pointer to the start of the shader's constant data.
Address space for constant memory (VTX2)
Calling convention used for Mesa/AMDPAL compute shaders.
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
Retuns the total number of operands.
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
SPIR_KERNEL - Calling convention for SPIR kernel functions.
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.
static Optional< unsigned > getOpcode(ArrayRef< VPValue *> Values)
Returns the opcode of Values or ~0 if they do not all agree.
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 ...
bool hasInstrModifiers(unsigned Opcode) const
Fast - This calling convention attempts to make calls as fast as possible (e.g.
unsigned getScalarSizeInBits() const
Calling convention used for AMDPAL shader stage before geometry shader if geometry is in use...
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...
Calling convention used for Mesa vertex shaders, or AMDPAL last shader stage before rasterization (ve...
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.
iterator find(const_arg_type_t< KeyT > Val)
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.
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...
Address space for indirect addressible parameter memory (VTX1)
Address space for local memory.
const R600InstrInfo * getInstrInfo() const override
unsigned getMachineOpcode() const
Calling convention used for AMDPAL vertex shader if tessellation is in use.
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.
Address space for global memory (RAT0, VTX0).
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
Calling convention used for Mesa/AMDPAL pixel shaders.
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.
#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.
bool isShader(CallingConv::ID cc)
Select(COND, TRUEVAL, FALSEVAL).
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
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.
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.
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 ...
Calling convention used for Mesa/AMDPAL hull shaders (= tessellation control shaders).
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)
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.
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.
Perform various unary floating-point operations inspired by libm.
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...
Calling convention for AMDGPU code object kernels.
LLVMContext * getContext() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
MachineInstr * buildMovImm(MachineBasicBlock &BB, MachineBasicBlock::iterator I, unsigned DstReg, uint64_t Imm) const
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.