14#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUISELDAGTODAG_H
15#define LLVM_LIB_TARGET_AMDGPU_AMDGPUISELDAGTODAG_H
36 Out =
C->getAPIntValue().getSExtValue();
41 Out =
C->getValueAPF().bitcastToAPInt().getSExtValue();
55 uint32_t K = (LHSVal & 0xffff) | (RHSVal << 16);
75 bool fp16SrcZerosHighBits(
unsigned Opc)
const;
93 std::pair<SDValue, SDValue> foldFrameIndex(
SDValue N)
const;
95 bool isInlineImmediate(
const SDNode *
N)
const;
97 bool isInlineImmediate(
const APInt &Imm)
const {
98 return Subtarget->getInstrInfo()->isInlineConstant(Imm);
101 bool isInlineImmediate(
const APFloat &Imm)
const {
105 bool isVGPRImm(
const SDNode *
N)
const;
106 bool isUniformLoad(
const SDNode *
N)
const;
107 bool isUniformBr(
const SDNode *
N)
const;
111 bool isUnneededShiftMask(
const SDNode *
N,
unsigned ShAmtBits)
const;
116 MachineSDNode *buildSMovImm64(SDLoc &
DL,
uint64_t Val, EVT VT)
const;
119 SDNode *glueCopyToM0(SDNode *
N,
SDValue Val)
const;
120 SDNode *glueCopyToM0LDSInit(SDNode *
N)
const;
122 const TargetRegisterClass *getOperandRegClass(SDNode *
N,
unsigned OpNo)
const;
126 bool isDSOffset2Legal(
SDValue Base,
unsigned Offset0,
unsigned Offset1,
127 unsigned Size)
const;
129 bool isFlatScratchBaseLegal(
SDValue Addr)
const;
130 bool isFlatScratchBaseLegalSV(
SDValue Addr)
const;
131 bool isFlatScratchBaseLegalSVImm(
SDValue Addr)
const;
132 bool isSOffsetLegalWithImmOffset(
SDValue *SOffset,
bool Imm32Only,
133 bool IsBuffer, int64_t ImmOffset = 0)
const;
147 bool SelectMUBUFScratchOffen(SDNode *Parent,
SDValue Addr,
SDValue &RSrc,
150 bool SelectMUBUFScratchOffset(SDNode *Parent,
SDValue Addr,
SDValue &SRsrc,
167 bool NeedIOffset =
true)
const;
180 bool SelectGlobalSAddrNoIOffset(SDNode *
N,
SDValue Addr,
SDValue &SAddr,
182 bool SelectGlobalSAddrNoIOffsetM0(SDNode *
N,
SDValue Addr,
SDValue &SAddr,
192 bool SelectSMRDOffset(SDNode *
N,
SDValue ByteOffsetNode,
SDValue *SOffset,
194 bool IsBuffer =
false,
bool HasSOffset =
false,
195 int64_t ImmOffset = 0,
196 bool *ScaleOffset =
nullptr)
const;
200 bool Imm32Only =
false,
bool IsBuffer =
false,
201 bool HasSOffset =
false, int64_t ImmOffset = 0,
202 bool *ScaleOffset =
nullptr)
const;
205 bool *ScaleOffset =
nullptr)
const;
208 bool SelectScaleOffset(SDNode *
N,
SDValue &
Offset,
bool IsSigned)
const;
222 bool SelectVOP3ModsImpl(
SDValue In,
SDValue &Src,
unsigned &SrcMods,
223 bool IsCanonicalizing =
true,
224 bool AllowAbs =
true)
const;
246 bool IsDOT =
false)
const;
265 bool SelectVOP3PMadMixModsImpl(
SDValue In,
SDValue &Src,
unsigned &Mods,
280 SDValue getMaterializedScalarImm32(int64_t Val,
const SDLoc &
DL)
const;
282 void SelectADD_SUB_I64(SDNode *
N);
283 void SelectAddcSubb(SDNode *
N);
284 void SelectUADDO_USUBO(SDNode *
N);
285 void SelectDIV_SCALE(SDNode *
N);
286 void SelectMAD_64_32(SDNode *
N);
287 void SelectMUL_LOHI(SDNode *
N);
288 void SelectFMA_W_CHAIN(SDNode *
N);
289 void SelectFMUL_W_CHAIN(SDNode *
N);
292 void SelectS_BFEFromShifts(SDNode *
N);
293 void SelectS_BFE(SDNode *
N);
294 bool isCBranchSCC(
const SDNode *
N)
const;
295 void SelectBRCOND(SDNode *
N);
296 void SelectFMAD_FMA(SDNode *
N);
297 void SelectFP_EXTEND(SDNode *
N);
298 void SelectDSAppendConsume(SDNode *
N,
unsigned IntrID);
299 void SelectDSBvhStackIntrinsic(SDNode *
N,
unsigned IntrID);
300 void SelectDS_GWS(SDNode *
N,
unsigned IntrID);
301 void SelectInterpP1F16(SDNode *
N);
302 void SelectINTRINSIC_W_CHAIN(SDNode *
N);
303 void SelectINTRINSIC_WO_CHAIN(SDNode *
N);
304 void SelectINTRINSIC_VOID(SDNode *
N);
305 void SelectWAVE_ADDRESS(SDNode *
N);
306 void SelectSTACKRESTORE(SDNode *
N);
310#include "AMDGPUGenDAGISel.inc"
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AMDGPU address space definition.
AMDGPU Register Bank Select
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
AMD GCN specific subclass of TargetSubtarget.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
AMDGPUDAGToDAGISelLegacy(TargetMachine &TM, CodeGenOptLevel OptLevel)
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
void SelectBuildVector(SDNode *N, unsigned RegClassID)
bool runOnMachineFunction(MachineFunction &MF) override
void SelectVectorShuffle(SDNode *N)
void PreprocessISelDAG() override
PreprocessISelDAG - This hook allows targets to hack on the graph before instruction selection starts...
AMDGPUDAGToDAGISel()=delete
void PostprocessISelDAG() override
PostprocessISelDAG() - This hook allows the target to hack on the graph right after selection.
bool matchLoadD16FromBuildVector(SDNode *N) const
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
AMDGPUISelDAGToDAGPass(TargetMachine &TM)
Class for arbitrary precision integers.
Represent the analysis usage information of a pass.
const SIInstrInfo * getInstrInfo() const override
A set of analyses that are preserved following a run of a transformation pass.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
bool isInlineConstant(const APInt &Imm) const
SelectionDAGISelLegacy(char &ID, std::unique_ptr< SelectionDAGISel > S)
SelectionDAGISelPass(std::unique_ptr< SelectionDAGISel > Selector)
SelectionDAGISel(TargetMachine &tm, CodeGenOptLevel OL=CodeGenOptLevel::Default)
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
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),...
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
@ C
The default llvm calling convention, compatible with C.
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
static bool getConstantValue(SDValue N, uint32_t &Out)
CodeGenOptLevel
Code generation optimization level.
static SDNode * packConstantV2I16(const SDNode *N, SelectionDAG &DAG)