LLVM 17.0.0git
AMDGPUISelLowering.h
Go to the documentation of this file.
1//===-- AMDGPUISelLowering.h - AMDGPU Lowering Interface --------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// Interface definition of the TargetLowering class that is common
11/// to all AMD GPUs.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUISELLOWERING_H
16#define LLVM_LIB_TARGET_AMDGPU_AMDGPUISELLOWERING_H
17
20
21namespace llvm {
22
23class AMDGPUMachineFunction;
24class AMDGPUSubtarget;
25struct ArgDescriptor;
26
28private:
29 const AMDGPUSubtarget *Subtarget;
30
31 /// \returns AMDGPUISD::FFBH_U32 node if the incoming \p Op may have been
32 /// legalized from a smaller type VT. Need to match pre-legalized type because
33 /// the generic legalization inserts the add/sub between the select and
34 /// compare.
35 SDValue getFFBX_U32(SelectionDAG &DAG, SDValue Op, const SDLoc &DL, unsigned Opc) const;
36
37public:
38 /// \returns The minimum number of bits needed to store the value of \Op as an
39 /// unsigned integer. Truncating to this size and then zero-extending to the
40 /// original size will not change the value.
41 static unsigned numBitsUnsigned(SDValue Op, SelectionDAG &DAG);
42
43 /// \returns The minimum number of bits needed to store the value of \Op as a
44 /// signed integer. Truncating to this size and then sign-extending to the
45 /// original size will not change the value.
46 static unsigned numBitsSigned(SDValue Op, SelectionDAG &DAG);
47
48protected:
51 /// Split a vector store into multiple scalar stores.
52 /// \returns The resulting chain.
53
54 SDValue LowerFREM(SDValue Op, SelectionDAG &DAG) const;
55 SDValue LowerFCEIL(SDValue Op, SelectionDAG &DAG) const;
57 SDValue LowerFRINT(SDValue Op, SelectionDAG &DAG) const;
59
64 double Log2BaseInverted) const;
65 SDValue lowerFEXP(SDValue Op, SelectionDAG &DAG) const;
66
68
73
77
79
80protected:
81 bool shouldCombineMemoryType(EVT VT) const;
86
88 unsigned Opc, SDValue LHS,
89 uint32_t ValLo, uint32_t ValHi) const;
99 SDValue RHS, DAGCombinerInfo &DCI) const;
100
102 SDValue N) const;
104
107
113
115
117 SelectionDAG &DAG) const;
118
119 /// Return 64-bit value Op as two 32-bit integers.
120 std::pair<SDValue, SDValue> split64BitValue(SDValue Op,
121 SelectionDAG &DAG) const;
122 SDValue getLoHalf64(SDValue Op, SelectionDAG &DAG) const;
123 SDValue getHiHalf64(SDValue Op, SelectionDAG &DAG) const;
124
125 /// Split a vector type into two parts. The first part is a power of two
126 /// vector. The second part is whatever is left over, and is a scalar if it
127 /// would otherwise be a 1-vector.
128 std::pair<EVT, EVT> getSplitDestVTs(const EVT &VT, SelectionDAG &DAG) const;
129
130 /// Split a vector value into two parts of types LoVT and HiVT. HiVT could be
131 /// scalar.
132 std::pair<SDValue, SDValue> splitVector(const SDValue &N, const SDLoc &DL,
133 const EVT &LoVT, const EVT &HighVT,
134 SelectionDAG &DAG) const;
135
136 /// Split a vector load into 2 loads of half the vector.
138
139 /// Widen a suitably aligned v3 load. For all other cases, split the input
140 /// vector load.
142
143 /// Split a vector store into 2 stores of half the vector.
145
149 SDValue LowerDIVREM24(SDValue Op, SelectionDAG &DAG, bool sign) const;
150 void LowerUDIVREM64(SDValue Op, SelectionDAG &DAG,
152
154 CCState &State,
155 const SmallVectorImpl<ISD::InputArg> &Ins) const;
156
157public:
159
160 bool mayIgnoreSignedZero(SDValue Op) const;
161
162 static inline SDValue stripBitcast(SDValue Val) {
163 return Val.getOpcode() == ISD::BITCAST ? Val.getOperand(0) : Val;
164 }
165
166 static bool shouldFoldFNegIntoSrc(SDNode *FNeg, SDValue FNegSrc);
167 static bool allUsesHaveSourceMods(const SDNode *N,
168 unsigned CostThreshold = 4);
169 bool isFAbsFree(EVT VT) const override;
170 bool isFNegFree(EVT VT) const override;
171 bool isTruncateFree(EVT Src, EVT Dest) const override;
172 bool isTruncateFree(Type *Src, Type *Dest) const override;
173
174 bool isZExtFree(Type *Src, Type *Dest) const override;
175 bool isZExtFree(EVT Src, EVT Dest) const override;
176
178 bool LegalOperations, bool ForCodeSize,
180 unsigned Depth) const override;
181
182 bool isNarrowingProfitable(EVT SrcVT, EVT DestVT) const override;
183
185 CombineLevel Level) const override;
186
188 ISD::NodeType ExtendKind) const override;
189
190 MVT getVectorIdxTy(const DataLayout &) const override;
191 bool isSelectSupported(SelectSupportKind) const override;
192
193 bool isFPImmLegal(const APFloat &Imm, EVT VT,
194 bool ForCodeSize) const override;
195 bool ShouldShrinkFPConstant(EVT VT) const override;
196 bool shouldReduceLoadWidth(SDNode *Load,
197 ISD::LoadExtType ExtType,
198 EVT ExtVT) const override;
199
201 const MachineMemOperand &MMO) const final;
202
203 bool storeOfVectorConstantIsCheap(bool IsZero, EVT MemVT,
204 unsigned NumElem,
205 unsigned AS) const override;
206 bool aggressivelyPreferBuildVectorSources(EVT VecVT) const override;
207 bool isCheapToSpeculateCttz(Type *Ty) const override;
208 bool isCheapToSpeculateCtlz(Type *Ty) const override;
209
210 bool isSDNodeAlwaysUniform(const SDNode *N) const override;
211 static CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg);
212 static CCAssignFn *CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg);
213
214 SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
216 const SmallVectorImpl<SDValue> &OutVals, const SDLoc &DL,
217 SelectionDAG &DAG) const override;
218
220 SelectionDAG &DAG,
221 MachineFrameInfo &MFI,
222 int ClobberedFI) const;
223
224 SDValue lowerUnhandledCall(CallLoweringInfo &CLI,
226 StringRef Reason) const;
227 SDValue LowerCall(CallLoweringInfo &CLI,
228 SmallVectorImpl<SDValue> &InVals) const override;
229
231 SelectionDAG &DAG) const;
232
233 SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
234 SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
237 SelectionDAG &DAG) const override;
238
240 SDValue RHS, SDValue True, SDValue False,
241 SDValue CC, DAGCombinerInfo &DCI) const;
242
244 SDValue RHS, SDValue True, SDValue False,
245 SDValue CC, DAGCombinerInfo &DCI) const;
246
247 const char* getTargetNodeName(unsigned Opcode) const override;
248
249 // FIXME: Turn off MergeConsecutiveStores() before Instruction Selection for
250 // AMDGPU. Commit r319036,
251 // (https://github.com/llvm/llvm-project/commit/db77e57ea86d941a4262ef60261692f4cb6893e6)
252 // turned on MergeConsecutiveStores() before Instruction Selection for all
253 // targets. Enough AMDGPU compiles go into an infinite loop (
254 // MergeConsecutiveStores() merges two stores; LegalizeStoreOps() un-merges;
255 // MergeConsecutiveStores() re-merges, etc. ) to warrant turning it off for
256 // now.
257 bool mergeStoresAfterLegalization(EVT) const override { return false; }
258
259 bool isFsqrtCheap(SDValue Operand, SelectionDAG &DAG) const override {
260 return true;
261 }
263 int &RefinementSteps, bool &UseOneConstNR,
264 bool Reciprocal) const override;
266 int &RefinementSteps) const override;
267
269 SelectionDAG &DAG) const = 0;
270
271 /// Determine which of the bits specified in \p Mask are known to be
272 /// either zero or one and return them in the \p KnownZero and \p KnownOne
273 /// bitsets.
275 KnownBits &Known,
276 const APInt &DemandedElts,
277 const SelectionDAG &DAG,
278 unsigned Depth = 0) const override;
279
280 unsigned ComputeNumSignBitsForTargetNode(SDValue Op, const APInt &DemandedElts,
281 const SelectionDAG &DAG,
282 unsigned Depth = 0) const override;
283
285 Register R,
286 const APInt &DemandedElts,
288 unsigned Depth = 0) const override;
289
291 const SelectionDAG &DAG,
292 bool SNaN = false,
293 unsigned Depth = 0) const override;
294
295 /// Helper function that adds Reg to the LiveIn list of the DAG's
296 /// MachineFunction.
297 ///
298 /// \returns a RegisterSDNode representing Reg if \p RawReg is true, otherwise
299 /// a copy from the register.
301 const TargetRegisterClass *RC,
302 Register Reg, EVT VT,
303 const SDLoc &SL,
304 bool RawReg = false) const;
306 const TargetRegisterClass *RC,
307 Register Reg, EVT VT) const {
308 return CreateLiveInRegister(DAG, RC, Reg, VT, SDLoc(DAG.getEntryNode()));
309 }
310
311 // Returns the raw live in register rather than a copy from it.
313 const TargetRegisterClass *RC,
314 Register Reg, EVT VT) const {
315 return CreateLiveInRegister(DAG, RC, Reg, VT, SDLoc(DAG.getEntryNode()), true);
316 }
317
318 /// Similar to CreateLiveInRegister, except value maybe loaded from a stack
319 /// slot rather than passed in a register.
321 EVT VT,
322 const SDLoc &SL,
323 int64_t Offset) const;
324
326 const SDLoc &SL,
327 SDValue Chain,
328 SDValue ArgVal,
329 int64_t Offset) const;
330
332 const TargetRegisterClass *RC,
333 EVT VT, const SDLoc &SL,
334 const ArgDescriptor &Arg) const;
335
341 };
342
343 /// Helper function that returns the byte offset of the given
344 /// type of implicit parameter.
346 const ImplicitParameter Param) const;
347 uint32_t getImplicitParameterOffset(const uint64_t ExplicitKernArgSize,
348 const ImplicitParameter Param) const;
349
350 MVT getFenceOperandTy(const DataLayout &DL) const override {
351 return MVT::i32;
352 }
353
355
356 bool isConstantUnsignedBitfieldExtractLegal(unsigned Opc, LLT Ty1,
357 LLT Ty2) const override;
358
360 SmallVectorImpl<Use *> &Ops) const override;
361};
362
363namespace AMDGPUISD {
364
365enum NodeType : unsigned {
366 // AMDIL ISD Opcodes
368 UMUL, // 32bit unsigned multiplication
370 // End AMDIL ISD Opcodes
371
372 // Function call.
377
378 // Masked control flow nodes.
382
383 // A uniform kernel return that terminates the wavefront.
385
386 // Return to a shader part's epilog code.
388
389 // Return with values from a non-entry function.
391
394
395 /// CLAMP value between 0.0 and 1.0. NaN clamped to 0, following clamp output
396 /// modifier behavior with dx10_enable.
398
399 // This is SETCC with the full mask result which is used for a compare with a
400 // result bit per item in the wavefront.
403
405
406 // FP ops with input and output chain.
409
410 // SIN_HW, COS_HW - f32 for SI, 1 ULP max error, valid from -100 pi to 100 pi.
411 // Denormals handled on some parts.
416
431 // For emitting ISD::FMAD when f32 denormals are enabled because mac/mad is
432 // treated as an illegal operation.
434
435 // RCP, RSQ - For f32, 1 ULP max error, no denormal handling.
436 // For f64, max error 2^29 ULP, handles denormals.
447 BFE_U32, // Extract range of bits with zero extension to 32-bits.
448 BFE_I32, // Extract range of bits with sign extension to 32-bits.
449 BFI, // (src0 & src1) | (~src0 & src2)
450 BFM, // Insert a range of bits into a 32-bit word.
451 FFBH_U32, // ctlz with -1 if input is zero.
453 FFBL_B32, // cttz with -1 if input is zero.
472
473 // These cvt_f32_ubyte* nodes need to remain consecutive and in order.
478
479 // Convert two float 32 numbers into a single register holding two packed f16
480 // with round to zero.
486
487 // Same as the standard node, except the high bits of the resulting integer
488 // are known 0.
490
491 /// This node is for VLIW targets and it is used to represent a vector
492 /// that is stored in consecutive registers with the same channel.
493 /// For example:
494 /// |X |Y|Z|W|
495 /// T0|v.x| | | |
496 /// T1|v.y| | | |
497 /// T2|v.z| | | |
498 /// T3|v.w| | | |
500 /// Pointer to the start of the shader's constant data.
506
515
557
560
561} // End namespace AMDGPUISD
562
563} // End namespace llvm
564
565#endif
unsigned const MachineRegisterInfo * MRI
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define AMDGPUSubtarget
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
Function Alias Analysis Results
SmallVector< MachineOperand, 4 > Cond
block Block Frequency Analysis
static cl::opt< unsigned > CostThreshold("dfa-cost-threshold", cl::desc("Maximum cost accepted for the transformation"), cl::Hidden, cl::init(50))
#define I(x, y, z)
Definition: MD5.cpp:58
unsigned Reg
LLVMContext & Context
This file describes how to lower LLVM code to machine code.
Value * RHS
Value * LHS
static unsigned numBitsSigned(SDValue Op, SelectionDAG &DAG)
SDValue combineFMinMaxLegacy(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, SDValue True, SDValue False, SDValue CC, DAGCombinerInfo &DCI) const
Generate Min/Max node.
unsigned ComputeNumSignBitsForTargetNode(SDValue Op, const APInt &DemandedElts, const SelectionDAG &DAG, unsigned Depth=0) const override
This method can be implemented by targets that want to expose additional information about sign bits ...
SDValue performMulhuCombine(SDNode *N, DAGCombinerInfo &DCI) const
EVT getTypeForExtReturn(LLVMContext &Context, EVT VT, ISD::NodeType ExtendKind) const override
Return the type that should be used to zero or sign extend a zeroext/signext integer return value.
SDValue SplitVectorLoad(SDValue Op, SelectionDAG &DAG) const
Split a vector load into 2 loads of half the vector.
SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG) const
SDValue performLoadCombine(SDNode *N, DAGCombinerInfo &DCI) const
void analyzeFormalArgumentsCompute(CCState &State, const SmallVectorImpl< ISD::InputArg > &Ins) const
The SelectionDAGBuilder will automatically promote function arguments with illegal types.
SDValue LowerFROUND(SDValue Op, SelectionDAG &DAG) const
SDValue storeStackInputValue(SelectionDAG &DAG, const SDLoc &SL, SDValue Chain, SDValue ArgVal, int64_t Offset) const
bool storeOfVectorConstantIsCheap(bool IsZero, EVT MemVT, unsigned NumElem, unsigned AS) const override
Return true if it is expected to be cheaper to do a store of vector constant with the given size and ...
SDValue LowerEXTRACT_SUBVECTOR(SDValue Op, SelectionDAG &DAG) const
void computeKnownBitsForTargetNode(const SDValue Op, KnownBits &Known, const APInt &DemandedElts, const SelectionDAG &DAG, unsigned Depth=0) const override
Determine which of the bits specified in Mask are known to be either zero or one and return them in t...
bool shouldCombineMemoryType(EVT VT) const
SDValue splitBinaryBitConstantOpImpl(DAGCombinerInfo &DCI, const SDLoc &SL, unsigned Opc, SDValue LHS, uint32_t ValLo, uint32_t ValHi) const
Split the 64-bit value LHS into two 32-bit components, and perform the binary operation Opc to it wit...
SDValue lowerUnhandledCall(CallLoweringInfo &CLI, SmallVectorImpl< SDValue > &InVals, StringRef Reason) const
SDValue performAssertSZExtCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const
bool isTruncateFree(EVT Src, EVT Dest) const override
bool aggressivelyPreferBuildVectorSources(EVT VecVT) const override
SDValue LowerFCEIL(SDValue Op, SelectionDAG &DAG) const
TargetLowering::NegatibleCost getConstantNegateCost(const ConstantFPSDNode *C) const
SDValue performMulhsCombine(SDNode *N, DAGCombinerInfo &DCI) const
AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *) const override
Returns how the IR-level AtomicExpand pass should expand the given AtomicRMW, if at all.
bool isSDNodeAlwaysUniform(const SDNode *N) const override
bool isDesirableToCommuteWithShift(const SDNode *N, CombineLevel Level) const override
Return true if it is profitable to move this shift by a constant amount through its operand,...
SDValue LowerFREM(SDValue Op, SelectionDAG &DAG) const
Split a vector store into multiple scalar stores.
virtual SDNode * PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const =0
SDValue performShlCombine(SDNode *N, DAGCombinerInfo &DCI) const
bool isCheapToSpeculateCtlz(Type *Ty) const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
SDValue LowerSDIVREM(SDValue Op, SelectionDAG &DAG) const
bool isFNegFree(EVT VT) const override
Return true if an fneg operation is free to the point where it is never worthwhile to replace it with...
SDValue LowerINT_TO_FP64(SDValue Op, SelectionDAG &DAG, bool Signed) 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...
SDValue LowerFP_TO_FP16(SDValue Op, SelectionDAG &DAG) const
SDValue addTokenForArgument(SDValue Chain, SelectionDAG &DAG, MachineFrameInfo &MFI, int ClobberedFI) const
bool isConstantCheaperToNegate(SDValue N) const
MVT getFenceOperandTy(const DataLayout &DL) const override
Return the type for operands of fence.
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 LowerFFLOOR(SDValue Op, SelectionDAG &DAG) const
SDValue performSelectCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue performFNegCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG) const
virtual SDValue LowerGlobalAddress(AMDGPUMachineFunction *MFI, SDValue Op, SelectionDAG &DAG) const
bool isConstantCostlierToNegate(SDValue N) const
SDValue loadInputValue(SelectionDAG &DAG, const TargetRegisterClass *RC, EVT VT, const SDLoc &SL, const ArgDescriptor &Arg) const
SDValue LowerDIVREM24(SDValue Op, SelectionDAG &DAG, bool sign) const
SDValue LowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG) const
SDValue CreateLiveInRegisterRaw(SelectionDAG &DAG, const TargetRegisterClass *RC, Register Reg, EVT VT) const
bool isCheapToSpeculateCttz(Type *Ty) const override
Return true if it is cheap to speculate a call to intrinsic cttz.
SDValue performCtlz_CttzCombine(const SDLoc &SL, SDValue Cond, SDValue LHS, SDValue RHS, DAGCombinerInfo &DCI) const
SDValue performSraCombine(SDNode *N, DAGCombinerInfo &DCI) const
bool isSelectSupported(SelectSupportKind) const override
bool isZExtFree(Type *Src, Type *Dest) const override
Return true if any actual instruction that defines a value of type FromTy implicitly zero-extends the...
SDValue LowerCall(CallLoweringInfo &CLI, SmallVectorImpl< SDValue > &InVals) const override
This hook must be implemented to lower calls into the specified DAG.
SDValue performSrlCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue lowerFEXP(SDValue Op, SelectionDAG &DAG) const
bool mayIgnoreSignedZero(SDValue Op) const
bool isLoadBitCastBeneficial(EVT, EVT, const SelectionDAG &DAG, const MachineMemOperand &MMO) const final
Return true if the following transform is beneficial: fold (conv (load x)) -> (load (conv*)x) On arch...
bool shouldReduceLoadWidth(SDNode *Load, ISD::LoadExtType ExtType, EVT ExtVT) const override
Return true if it is profitable to reduce a load to a smaller type.
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...
std::pair< SDValue, SDValue > splitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT, const EVT &HighVT, SelectionDAG &DAG) const
Split a vector value into two parts of types LoVT and HiVT.
SDValue foldFreeOpFromSelect(TargetLowering::DAGCombinerInfo &DCI, SDValue N) const
bool shouldSinkOperands(Instruction *I, SmallVectorImpl< Use * > &Ops) const override
Whether it is profitable to sink the operands of an Instruction I to the basic block of I.
SDValue LowerINT_TO_FP32(SDValue Op, SelectionDAG &DAG, bool Signed) const
bool isFAbsFree(EVT VT) const override
Return true if an fabs operation is free to the point where it is never worthwhile to replace it with...
SDValue loadStackInputValue(SelectionDAG &DAG, EVT VT, const SDLoc &SL, int64_t Offset) const
Similar to CreateLiveInRegister, except value maybe loaded from a stack slot rather than passed in a ...
bool isNarrowingProfitable(EVT SrcVT, EVT DestVT) const override
Return true if it's profitable to narrow operations of type SrcVT to DestVT.
static EVT getEquivalentMemType(LLVMContext &Context, EVT VT)
SDValue getSqrtEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled, int &RefinementSteps, bool &UseOneConstNR, bool Reciprocal) const override
Hooks for building estimates in place of slower divisions and square roots.
unsigned computeNumSignBitsForTargetInstr(GISelKnownBits &Analysis, Register R, const APInt &DemandedElts, const MachineRegisterInfo &MRI, unsigned Depth=0) const override
This method can be implemented by targets that want to expose additional information about sign bits ...
SDValue performTruncateCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue LowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG) const
static SDValue stripBitcast(SDValue Val)
SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC, Register Reg, EVT VT, const SDLoc &SL, bool RawReg=false) const
Helper function that adds Reg to the LiveIn list of the DAG's MachineFunction.
SDValue SplitVectorStore(SDValue Op, SelectionDAG &DAG) const
Split a vector store into 2 stores of half the vector.
SDValue LowerCTLZ_CTTZ(SDValue Op, SelectionDAG &DAG) const
SDValue getNegatedExpression(SDValue Op, SelectionDAG &DAG, bool LegalOperations, bool ForCodeSize, NegatibleCost &Cost, unsigned Depth) const override
Return the newly negated expression if the cost is not expensive and set the cost in Cost to indicate...
std::pair< SDValue, SDValue > split64BitValue(SDValue Op, SelectionDAG &DAG) const
Return 64-bit value Op as two 32-bit integers.
SDValue performMulCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue getRecipEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled, int &RefinementSteps) const override
Return a reciprocal estimate value for the input operand.
SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC, Register Reg, EVT VT) const
SDValue LowerFNEARBYINT(SDValue Op, SelectionDAG &DAG) const
const char * getTargetNodeName(unsigned Opcode) const override
This method returns the name of a target specific DAG node.
SDValue LowerSIGN_EXTEND_INREG(SDValue Op, SelectionDAG &DAG) const
static CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg)
static CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg)
Selects the correct CCAssignFn for a given CallingConvention value.
static bool allUsesHaveSourceMods(const SDNode *N, unsigned CostThreshold=4)
SDValue LowerFROUNDEVEN(SDValue Op, SelectionDAG &DAG) const
bool isFPImmLegal(const APFloat &Imm, EVT VT, bool ForCodeSize) const override
Returns true if the target can instruction select the specified FP immediate natively.
bool isKnownNeverNaNForTargetNode(SDValue Op, const SelectionDAG &DAG, bool SNaN=false, unsigned Depth=0) const override
If SNaN is false,.
static unsigned numBitsUnsigned(SDValue Op, SelectionDAG &DAG)
SDValue LowerFTRUNC(SDValue Op, SelectionDAG &DAG) const
SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const
bool ShouldShrinkFPConstant(EVT VT) const override
If true, then instruction selection should seek to shrink the FP constant of the specified type to a ...
SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< SDValue > &OutVals, const SDLoc &DL, SelectionDAG &DAG) const override
This hook must be implemented to lower outgoing return values, described by the Outs array,...
SDValue performStoreCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue LowerFLOG(SDValue Op, SelectionDAG &DAG, double Log2BaseInverted) const
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 performRcpCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue getLoHalf64(SDValue Op, SelectionDAG &DAG) const
SDValue performFAbsCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue LowerFP_TO_INT64(SDValue Op, SelectionDAG &DAG, bool Signed) const
static bool shouldFoldFNegIntoSrc(SDNode *FNeg, SDValue FNegSrc)
SDValue LowerFRINT(SDValue Op, SelectionDAG &DAG) const
SDValue performIntrinsicWOChainCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue LowerUDIVREM(SDValue Op, SelectionDAG &DAG) const
SDValue performMulLoHiCombine(SDNode *N, DAGCombinerInfo &DCI) const
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
SDValue WidenOrSplitVectorLoad(SDValue Op, SelectionDAG &DAG) const
Widen a suitably aligned v3 load.
bool mergeStoresAfterLegalization(EVT) const override
Allow store merging for the specified type after legalization in addition to before legalization.
std::pair< EVT, EVT > getSplitDestVTs(const EVT &VT, SelectionDAG &DAG) const
Split a vector type into two parts.
SDValue getHiHalf64(SDValue Op, SelectionDAG &DAG) const
bool isFsqrtCheap(SDValue Operand, SelectionDAG &DAG) const override
Return true if SQRT(X) shouldn't be replaced with X*RSQRT(X).
SDValue combineFMinMaxLegacyImpl(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, SDValue True, SDValue False, SDValue CC, DAGCombinerInfo &DCI) const
bool isConstantUnsignedBitfieldExtractLegal(unsigned Opc, LLT Ty1, LLT Ty2) const override
Class for arbitrary precision integers.
Definition: APInt.h:75
an instruction that atomically reads a memory location, combines it with another value,...
Definition: Instructions.h:718
CCState - This class holds information needed while lowering arguments and return values.
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:110
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:67
Machine Value Type.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
A description of a memory reference used in the backend.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
An SDNode that represents everything that will be needed to construct a MachineInstr.
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
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.
const SDValue & getOperand(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...
Definition: SelectionDAG.h:225
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
Definition: SelectionDAG.h:554
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:577
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
SelectSupportKind
Enum that describes what type of support for selects the target has.
AtomicExpansionKind
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.
NegatibleCost
Enum that specifies when a float negation is beneficial.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:78
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
@ BUILD_VERTICAL_VECTOR
This node is for VLIW targets and it is used to represent a vector that is stored in consecutive regi...
@ CONST_DATA_PTR
Pointer to the start of the shader's constant data.
@ CLAMP
CLAMP value between 0.0 and 1.0.
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
Definition: ISDOpcodes.h:40
@ BITCAST
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
Definition: ISDOpcodes.h:899
@ BUILTIN_OP_END
BUILTIN_OP_END - This must be the last enum value in this list.
Definition: ISDOpcodes.h:1351
static const int FIRST_TARGET_MEMORY_OPCODE
FIRST_TARGET_MEMORY_OPCODE - Target-specific pre-isel operations which do not reference a specific me...
Definition: ISDOpcodes.h:1363
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
Definition: ISDOpcodes.h:1454
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:440
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.
CombineLevel
Definition: DAGCombine.h:15
#define N
Extended Value Type.
Definition: ValueTypes.h:34