23#include "llvm/IR/IntrinsicsNVPTX.h"
33#define DEBUG_TYPE "NVPTXtti"
37 switch (
II->getIntrinsicID()) {
38 default:
return false;
39 case Intrinsic::nvvm_read_ptx_sreg_tid_x:
40 case Intrinsic::nvvm_read_ptx_sreg_tid_y:
41 case Intrinsic::nvvm_read_ptx_sreg_tid_z:
47 return II->getIntrinsicID() == Intrinsic::nvvm_read_ptx_sreg_laneid;
50bool NVPTXTTIImpl::isSourceOfDivergence(
const Value *V)
const {
60 unsigned AS = LI->getPointerAddressSpace();
102 enum FtzRequirementTy {
112 SCP_FunnelShiftClamp,
117 struct SimplifyAction {
119 std::optional<Intrinsic::ID> IID;
120 std::optional<Instruction::CastOps> CastOp;
121 std::optional<Instruction::BinaryOps> BinaryOp;
122 std::optional<SpecialCase> Special;
124 FtzRequirementTy FtzRequirement = FTZ_Any;
127 bool IsHalfTy =
false;
129 SimplifyAction() =
default;
132 bool IsHalfTy =
false)
133 : IID(IID), FtzRequirement(FtzReq), IsHalfTy(IsHalfTy) {}
140 :
BinaryOp(BinaryOp), FtzRequirement(FtzReq) {}
142 SimplifyAction(SpecialCase Special, FtzRequirementTy FtzReq)
143 : Special(Special), FtzRequirement(FtzReq) {}
148 const SimplifyAction Action = [
II]() -> SimplifyAction {
149 switch (
II->getIntrinsicID()) {
151 case Intrinsic::nvvm_ceil_d:
152 return {Intrinsic::ceil, FTZ_Any};
153 case Intrinsic::nvvm_ceil_f:
154 return {Intrinsic::ceil, FTZ_MustBeOff};
155 case Intrinsic::nvvm_ceil_ftz_f:
156 return {Intrinsic::ceil, FTZ_MustBeOn};
157 case Intrinsic::nvvm_floor_d:
158 return {Intrinsic::floor, FTZ_Any};
159 case Intrinsic::nvvm_floor_f:
160 return {Intrinsic::floor, FTZ_MustBeOff};
161 case Intrinsic::nvvm_floor_ftz_f:
162 return {Intrinsic::floor, FTZ_MustBeOn};
163 case Intrinsic::nvvm_fma_rn_d:
164 return {Intrinsic::fma, FTZ_Any};
165 case Intrinsic::nvvm_fma_rn_f:
166 return {Intrinsic::fma, FTZ_MustBeOff};
167 case Intrinsic::nvvm_fma_rn_ftz_f:
168 return {Intrinsic::fma, FTZ_MustBeOn};
169 case Intrinsic::nvvm_fma_rn_f16:
170 return {Intrinsic::fma, FTZ_MustBeOff,
true};
171 case Intrinsic::nvvm_fma_rn_ftz_f16:
172 return {Intrinsic::fma, FTZ_MustBeOn,
true};
173 case Intrinsic::nvvm_fma_rn_f16x2:
174 return {Intrinsic::fma, FTZ_MustBeOff,
true};
175 case Intrinsic::nvvm_fma_rn_ftz_f16x2:
176 return {Intrinsic::fma, FTZ_MustBeOn,
true};
177 case Intrinsic::nvvm_fma_rn_bf16:
178 return {Intrinsic::fma, FTZ_MustBeOff,
true};
179 case Intrinsic::nvvm_fma_rn_bf16x2:
180 return {Intrinsic::fma, FTZ_MustBeOff,
true};
181 case Intrinsic::nvvm_fmax_d:
182 return {Intrinsic::maximumnum, FTZ_Any};
183 case Intrinsic::nvvm_fmax_f:
184 return {Intrinsic::maximumnum, FTZ_MustBeOff};
185 case Intrinsic::nvvm_fmax_ftz_f:
186 return {Intrinsic::maximumnum, FTZ_MustBeOn};
187 case Intrinsic::nvvm_fmax_nan_f:
188 return {Intrinsic::maximum, FTZ_MustBeOff};
189 case Intrinsic::nvvm_fmax_ftz_nan_f:
190 return {Intrinsic::maximum, FTZ_MustBeOn};
191 case Intrinsic::nvvm_fmax_f16:
192 return {Intrinsic::maximumnum, FTZ_MustBeOff,
true};
193 case Intrinsic::nvvm_fmax_ftz_f16:
194 return {Intrinsic::maximumnum, FTZ_MustBeOn,
true};
195 case Intrinsic::nvvm_fmax_f16x2:
196 return {Intrinsic::maximumnum, FTZ_MustBeOff,
true};
197 case Intrinsic::nvvm_fmax_ftz_f16x2:
198 return {Intrinsic::maximumnum, FTZ_MustBeOn,
true};
199 case Intrinsic::nvvm_fmax_nan_f16:
200 return {Intrinsic::maximum, FTZ_MustBeOff,
true};
201 case Intrinsic::nvvm_fmax_ftz_nan_f16:
202 return {Intrinsic::maximum, FTZ_MustBeOn,
true};
203 case Intrinsic::nvvm_fmax_nan_f16x2:
204 return {Intrinsic::maximum, FTZ_MustBeOff,
true};
205 case Intrinsic::nvvm_fmax_ftz_nan_f16x2:
206 return {Intrinsic::maximum, FTZ_MustBeOn,
true};
207 case Intrinsic::nvvm_fmin_d:
208 return {Intrinsic::minimumnum, FTZ_Any};
209 case Intrinsic::nvvm_fmin_f:
210 return {Intrinsic::minimumnum, FTZ_MustBeOff};
211 case Intrinsic::nvvm_fmin_ftz_f:
212 return {Intrinsic::minimumnum, FTZ_MustBeOn};
213 case Intrinsic::nvvm_fmin_nan_f:
214 return {Intrinsic::minimum, FTZ_MustBeOff};
215 case Intrinsic::nvvm_fmin_ftz_nan_f:
216 return {Intrinsic::minimum, FTZ_MustBeOn};
217 case Intrinsic::nvvm_fmin_f16:
218 return {Intrinsic::minimumnum, FTZ_MustBeOff,
true};
219 case Intrinsic::nvvm_fmin_ftz_f16:
220 return {Intrinsic::minimumnum, FTZ_MustBeOn,
true};
221 case Intrinsic::nvvm_fmin_f16x2:
222 return {Intrinsic::minimumnum, FTZ_MustBeOff,
true};
223 case Intrinsic::nvvm_fmin_ftz_f16x2:
224 return {Intrinsic::minimumnum, FTZ_MustBeOn,
true};
225 case Intrinsic::nvvm_fmin_nan_f16:
226 return {Intrinsic::minimum, FTZ_MustBeOff,
true};
227 case Intrinsic::nvvm_fmin_ftz_nan_f16:
228 return {Intrinsic::minimum, FTZ_MustBeOn,
true};
229 case Intrinsic::nvvm_fmin_nan_f16x2:
230 return {Intrinsic::minimum, FTZ_MustBeOff,
true};
231 case Intrinsic::nvvm_fmin_ftz_nan_f16x2:
232 return {Intrinsic::minimum, FTZ_MustBeOn,
true};
233 case Intrinsic::nvvm_sqrt_rn_d:
234 return {Intrinsic::sqrt, FTZ_Any};
235 case Intrinsic::nvvm_sqrt_f:
240 return {Intrinsic::sqrt, FTZ_Any};
241 case Intrinsic::nvvm_trunc_d:
242 return {Intrinsic::trunc, FTZ_Any};
243 case Intrinsic::nvvm_trunc_f:
244 return {Intrinsic::trunc, FTZ_MustBeOff};
245 case Intrinsic::nvvm_trunc_ftz_f:
246 return {Intrinsic::trunc, FTZ_MustBeOn};
255 case Intrinsic::nvvm_i2d_rn:
256 case Intrinsic::nvvm_i2f_rn:
257 case Intrinsic::nvvm_ll2d_rn:
258 case Intrinsic::nvvm_ll2f_rn:
259 return {Instruction::SIToFP};
260 case Intrinsic::nvvm_ui2d_rn:
261 case Intrinsic::nvvm_ui2f_rn:
262 case Intrinsic::nvvm_ull2d_rn:
263 case Intrinsic::nvvm_ull2f_rn:
264 return {Instruction::UIToFP};
267 case Intrinsic::nvvm_div_rn_d:
268 return {Instruction::FDiv, FTZ_Any};
275 case Intrinsic::nvvm_rcp_rn_d:
276 return {SPC_Reciprocal, FTZ_Any};
278 case Intrinsic::nvvm_fshl_clamp:
279 case Intrinsic::nvvm_fshr_clamp:
280 return {SCP_FunnelShiftClamp, FTZ_Any};
311 if (Action.FtzRequirement != FTZ_Any) {
317 if (FtzEnabled != (Action.FtzRequirement == FTZ_MustBeOn))
326 Type *Tys[] = {
II->getArgOperand(0)->getType()};
335 II->getArgOperand(1),
II->getName());
346 switch (*Action.Special) {
350 Instruction::FDiv, ConstantFP::get(
II->getArgOperand(0)->getType(), 1),
351 II->getArgOperand(0),
II->getName());
353 case SCP_FunnelShiftClamp: {
357 const bool IsLeft =
II->getIntrinsicID() == Intrinsic::nvvm_fshl_clamp;
358 if (ShiftConst->getZExtValue() >=
II->getType()->getIntegerBitWidth())
361 const unsigned FshIID = IsLeft ? Intrinsic::fshl : Intrinsic::fshr;
363 II->getModule(), FshIID,
II->getType()),
369 llvm_unreachable(
"All SpecialCase enumerators should be handled in switch.");
381 return AS == SpecificAS ||
389 case Intrinsic::nvvm_isspacep_global:
391 case Intrinsic::nvvm_isspacep_local:
393 case Intrinsic::nvvm_isspacep_shared:
395 case Intrinsic::nvvm_isspacep_shared_cluster:
397 case Intrinsic::nvvm_isspacep_const:
410static std::optional<Instruction *>
413 switch (
auto IID =
II.getIntrinsicID()) {
414 case Intrinsic::nvvm_isspacep_global:
415 case Intrinsic::nvvm_isspacep_local:
416 case Intrinsic::nvvm_isspacep_shared:
417 case Intrinsic::nvvm_isspacep_shared_cluster:
418 case Intrinsic::nvvm_isspacep_const: {
419 Value *Op0 =
II.getArgOperand(0);
425 AS = ASCO->getOperand(0)->getType()->getPointerAddressSpace();
429 ConstantInt::get(
II.getType(), *Answer));
439 switch (
II.getIntrinsicID()) {
440 case Intrinsic::nvvm_redux_sync_fmin:
441 case Intrinsic::nvvm_redux_sync_fmin_abs:
442 AbsIID = Intrinsic::nvvm_redux_sync_fmin_abs;
444 case Intrinsic::nvvm_redux_sync_fmax:
445 case Intrinsic::nvvm_redux_sync_fmax_abs:
446 AbsIID = Intrinsic::nvvm_redux_sync_fmax_abs;
448 case Intrinsic::nvvm_redux_sync_fmin_NaN:
449 case Intrinsic::nvvm_redux_sync_fmin_abs_NaN:
450 AbsIID = Intrinsic::nvvm_redux_sync_fmin_abs_NaN;
452 case Intrinsic::nvvm_redux_sync_fmax_NaN:
453 case Intrinsic::nvvm_redux_sync_fmax_abs_NaN:
454 AbsIID = Intrinsic::nvvm_redux_sync_fmax_abs_NaN;
461 if (!Abs || Abs->getIntrinsicID() != Intrinsic::fabs)
464 II.setCalledFunction(
467 II.removeParamAttr(0, Attribute::NoFPClass);
468 II.removeParamAttr(0, Attribute::Returned);
472std::optional<Instruction *>
495 const unsigned InstCount =
498 AsmInst = AsmInst.
trim().
ltrim(
"{} \t\n\v\f\r");
502 return !AsmInst.
empty() &&
503 (AsmInst[0] ==
'@' ||
isAlpha(AsmInst[0]) ||
519 int ISD = TLI->InstructionOpcodeToISD(Opcode);
533 if (LT.second.SimpleTy == MVT::i64)
560enum class InvalidAddressSpaceAction { LeaveUnchanged,
Trap };
566struct IntrinsicAddressSpaceInfo {
570 InvalidAddressSpaceAction InvalidAction;
571 unsigned PointerOperand;
573 IntrinsicAddressSpaceInfo(
576 InvalidAddressSpaceAction InvalidAction = InvalidAddressSpaceAction::Trap,
577 unsigned PointerOperand = 0)
578 : GenericID(GenericID), SpecificID(SpecificID),
579 AddressSpaces(AddressSpaces), InvalidAction(InvalidAction),
580 PointerOperand(PointerOperand) {}
582 IntrinsicAddressSpaceInfo(
585 InvalidAddressSpaceAction InvalidAction = InvalidAddressSpaceAction::Trap,
586 unsigned PointerOperand = 0)
587 : IntrinsicAddressSpaceInfo(IID, IID, AddressSpaces, InvalidAction,
592static const IntrinsicAddressSpaceInfo *
594 static const auto Infos = [] {
595 const IntrinsicAddressSpaceInfo Entries[] = {
596 {Intrinsic::nvvm_mbarrier_init},
597 {Intrinsic::nvvm_mbarrier_inval, Intrinsic::nvvm_mbarrier_inval_shared},
598 {Intrinsic::nvvm_mbarrier_check_layout},
599 {Intrinsic::nvvm_mbarrier_arrive,
600 Intrinsic::nvvm_mbarrier_arrive_shared},
601 {Intrinsic::nvvm_mbarrier_arrive_noComplete,
602 Intrinsic::nvvm_mbarrier_arrive_noComplete_shared},
603 {Intrinsic::nvvm_mbarrier_arrive_drop,
604 Intrinsic::nvvm_mbarrier_arrive_drop_shared},
605 {Intrinsic::nvvm_mbarrier_arrive_drop_noComplete,
606 Intrinsic::nvvm_mbarrier_arrive_drop_noComplete_shared},
607 {Intrinsic::nvvm_mbarrier_test_wait,
608 Intrinsic::nvvm_mbarrier_test_wait_shared},
609 {Intrinsic::nvvm_cp_async_mbarrier_arrive,
610 Intrinsic::nvvm_cp_async_mbarrier_arrive_shared},
611 {Intrinsic::nvvm_cp_async_mbarrier_arrive_noinc,
612 Intrinsic::nvvm_cp_async_mbarrier_arrive_noinc_shared},
615 {Intrinsic::nvvm_prefetch_tensormap,
617 InvalidAddressSpaceAction::LeaveUnchanged},
621 return std::pair{Info.GenericID, Info};
624 auto It = Infos.find(IID);
625 return It == Infos.end() ? nullptr : &It->second;
631 OpIndexes.
push_back(Info->PointerOperand);
635 case Intrinsic::nvvm_isspacep_const:
636 case Intrinsic::nvvm_isspacep_global:
637 case Intrinsic::nvvm_isspacep_local:
638 case Intrinsic::nvvm_isspacep_shared:
639 case Intrinsic::nvvm_isspacep_shared_cluster: {
652 if (
II->getArgOperand(Info->PointerOperand) != OldV)
660 if (Info->InvalidAction == InvalidAddressSpaceAction::LeaveUnchanged ||
661 !
llvm::all_of(Info->AddressSpaces, [NewAS](
unsigned AS) {
662 return isInAddressSpace(NewAS, AS) == false;
672 ArgTypes[Info->PointerOperand] = NewV->
getType();
678 II->getModule(), Info->SpecificID, OverloadTypes);
679 II->setArgOperand(Info->PointerOperand, NewV);
680 II->setCalledFunction(Decl);
684 case Intrinsic::nvvm_isspacep_const:
685 case Intrinsic::nvvm_isspacep_global:
686 case Intrinsic::nvvm_isspacep_local:
687 case Intrinsic::nvvm_isspacep_shared:
688 case Intrinsic::nvvm_isspacep_shared_cluster: {
691 return ConstantInt::get(
II->getType(), *R);
709 if (!ST->has256BitVectorLoadStore(AddrSpace))
716 auto *
ElemTy = VTy->getScalarType();
717 return (
ElemTy->getScalarSizeInBits() == 32 && VTy->getNumElements() == 8) ||
718 (
ElemTy->getScalarSizeInBits() == 64 && VTy->getNumElements() == 4);
727 if (Alignment <
DL.getTypeStoreSize(DataTy))
734 return VTy->getElementType()->getScalarSizeInBits() >= 8;
739 if (ST->has256BitVectorLoadStore(AddrSpace))
758 if (Arg->hasByValAttr())
770 LB.push_back({
"maxclusterrank", *Val});
773 if (MaxNTID.
size() > 0)
774 LB.push_back({
"maxntidx", MaxNTID[0]});
775 if (MaxNTID.
size() > 1)
776 LB.push_back({
"maxntidy", MaxNTID[1]});
777 if (MaxNTID.
size() > 2)
778 LB.push_back({
"maxntidz", MaxNTID[2]});
785 const unsigned AS = GV->getAddressSpace();
794 if (isSourceOfDivergence(V))
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static cl::opt< OutputCostKind > CostKind("cost-kind", cl::desc("Target cost kind"), cl::init(OutputCostKind::RecipThroughput), cl::values(clEnumValN(OutputCostKind::RecipThroughput, "throughput", "Reciprocal throughput"), clEnumValN(OutputCostKind::Latency, "latency", "Instruction latency"), clEnumValN(OutputCostKind::CodeSize, "code-size", "Code size"), clEnumValN(OutputCostKind::SizeAndLatency, "size-latency", "Code size and latency"), clEnumValN(OutputCostKind::All, "all", "Print all cost kinds")))
This file defines the DenseMap class.
This file provides the interface for the instcombine pass implementation.
NVPTX address space definition.
uint64_t IntrinsicInst * II
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
This file defines the SmallVector class.
This file describes how to lower LLVM code to machine code.
static const fltSemantics & IEEEsingle()
static const fltSemantics & IEEEhalf()
This class represents an incoming formal argument to a Function.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
InstructionCost getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Opd1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Opd2Info={TTI::OK_AnyValue, TTI::OP_None}, ArrayRef< const Value * > Args={}, const Instruction *CtxI=nullptr) const override
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, OptimizationRemarkEmitter *ORE) const override
void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP) const override
std::pair< InstructionCost, MVT > getTypeLegalizationCost(Type *Ty) const
static LLVM_ABI BinaryOperator * Create(BinaryOps Op, Value *S1, Value *S2, const Twine &Name=Twine(), InsertPosition InsertBefore=nullptr)
Construct a binary instruction, given the opcode and the two operands.
static CallInst * Create(FunctionType *Ty, Value *F, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
static LLVM_ABI CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's ...
This is an important base class in LLVM.
Class to represent function types.
static LLVM_ABI FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
The core instruction combiner logic.
Instruction * replaceInstUsesWith(Instruction &I, Value *V)
A combiner-aware RAUW-like routine.
Instruction * replaceOperand(Instruction &I, unsigned OpNum, Value *V)
Replace operand of instruction and add old operand to the worklist.
A wrapper class for inspecting calls to intrinsic functions.
Represents a single loop in the control flow graph.
bool isLegalMaskedStore(Type *DataType, Align Alignment, unsigned AddrSpace, TTI::MaskKind MaskKind) const override
Value * rewriteIntrinsicWithAddressSpace(IntrinsicInst *II, Value *OldV, Value *NewV) const override
InstructionCost getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Op1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Op2Info={TTI::OK_AnyValue, TTI::OP_None}, ArrayRef< const Value * > Args={}, const Instruction *CtxI=nullptr) const override
InstructionCost getInstructionCost(const User *U, ArrayRef< const Value * > Operands, TTI::TargetCostKind CostKind) const override
bool shouldBuildLookupTablesForConstant(Constant *C) const override
unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const override
std::optional< Instruction * > instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const override
ValueUniformity getValueUniformity(const Value *V) const override
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, OptimizationRemarkEmitter *ORE) const override
void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP) const override
bool collectFlatAddressOperands(SmallVectorImpl< int > &OpIndexes, Intrinsic::ID IID) const override
unsigned getAssumedAddrSpace(const Value *V) const override
void collectKernelLaunchBounds(const Function &F, SmallVectorImpl< std::pair< StringRef, int64_t > > &LB) const override
bool isLegalMaskedLoad(Type *DataType, Align Alignment, unsigned AddrSpace, TTI::MaskKind MaskKind) const override
NVPTX::DrvInterface getDrvInterface() const
static LLVM_ABI PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
The main scalar evolution driver.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
constexpr bool empty() const
Check if the string is empty.
constexpr size_t size() const
Get the string size.
StringRef ltrim(char Char) const
Return string with consecutive Char characters starting from the the left removed.
bool contains(StringRef Other) const
Return true if the given string is a substring of *this, and false otherwise.
StringRef trim(char Char) const
Return string with consecutive Char characters starting from the left and right removed.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM_ABI unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
ISD namespace - This namespace contains an enum which represents all of the SelectionDAG node types a...
@ ADD
Simple integer binary arithmetic operators.
@ AND
Bitwise operators - logical and, logical or, logical xor.
LLVM_ABI Function * getOrInsertDeclaration(Module *M, ID id, ArrayRef< Type * > OverloadTys={})
Look up the Function declaration of the intrinsic id in the Module M.
LLVM_ABI bool isSignatureValid(Intrinsic::ID ID, FunctionType *FT, SmallVectorImpl< Type * > &OverloadTys, raw_ostream &OS=nulls())
Returns true if FT is a valid function type for intrinsic ID.
@ ADDRESS_SPACE_ENTRY_PARAM
@ ADDRESS_SPACE_SHARED_CLUSTER
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
@ BinaryOp
One of the operands is a binary op.
constexpr from_range_t from_range
auto map_range(ContainerTy &&C, FuncTy F)
Return a range that applies F to the elements of C.
bool isAlpha(char C)
Checks if character C is a valid letter as classified by "C" locale.
SmallVector< unsigned, 3 > getMaxNTID(const Function &)
IRBuilder(LLVMContext &, FolderTy, InserterTy) -> IRBuilder< FolderTy, InserterTy >
std::optional< unsigned > getMaxClusterRank(const Function &)
iterator_range< SplittingIterator > split(StringRef Str, StringRef Separator)
Split the specified string over a separator and return a range-compatible iterable over its partition...
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
auto count_if(R &&Range, UnaryPredicate P)
Wrapper function around std::count_if to count the number of times an element satisfying a given pred...
bool isKernelFunction(const Function &F)
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
ValueUniformity
Enum describing how values behave with respect to uniformity and divergence, to answer the question: ...
@ NeverUniform
The result value can never be assumed to be uniform.
@ Default
The result value is uniform if and only if all operands are uniform.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Represent subnormal handling kind for floating point instruction inputs and outputs.
@ PreserveSign
The sign of a flushed-to-zero number is preserved in the sign of 0.