13#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
14#define LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
72 return Ty->isAggregateType() || Ty->isVectorTy() ||
73 Ty->getScalarSizeInBits() >= 128 || Ty->isHalfTy() || Ty->isBFloatTy();
81 static const auto PackedTypes = {MVT::v4i8, MVT::v2f16, MVT::v2bf16,
82 MVT::v2i16, MVT::v2f32, MVT::v2i32};
98 std::string ValidName;
99 ValidName.reserve(Name.size() + 4);
104 ValidName.push_back(
C);
106 ValidName.append({
'_',
'$',
'_'});
122 return "AcquireRelease";
124 return "SequentiallyConsistent";
128 return "RelaxedMMIO";
152 return "DefaultDevice";
164 bool UseParamSubqualifiers =
false) {
175 return "shared::cluster";
177 return UseParamSubqualifiers ?
"param::entry" :
"param";
179 return UseParamSubqualifiers ?
"param::func" :
"param";
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
A parsed version of the target data layout string in and methods for querying it.
This is an abstract virtual class for memory operations.
Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
This class implements an extremely fast bulk output stream that can only output to a stream.
const char * addressSpaceToString(AddressSpace A, bool UseParamSubqualifiers=false)
raw_ostream & operator<<(raw_ostream &O, Ordering Order)
unsigned int OrderingUnderlyingType
std::string ScopeToString(Scope S)
std::string OrderingToString(Ordering Order)
unsigned int ScopeUnderlyingType
bool isPackedVectorTy(EVT VT)
bool isPackedElementTy(EVT ET)
unsigned int AddressSpaceUnderlyingType
std::string getValidPTXIdentifier(StringRef Name)
This is an optimization pass for GlobalISel generic memory operations.
Align getDeviceByValParamAlign(const Function *F, Type *ArgTy, unsigned AttrIdx, const DataLayout &DL)
The .param-space alignment for a byval parameter or call argument: the (possibly promoted) parameter ...
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Align getPTXParamTypeAlign(Type *ArgTy, const DataLayout &DL)
ABI alignment of ArgTy in .param space, capped at the PTX maximum of 128.
constexpr auto equal_to(T &&Arg)
Functor variant of std::equal_to that can be used as a UnaryPredicate in functional algorithms like a...
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
unsigned promoteScalarArgumentSize(unsigned size)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
bool shouldPassAsArray(Type *Ty)
bool isAlnum(char C)
Checks whether character C is either a decimal digit or an uppercase or lowercase letter as classifie...
Align getPTXParamAlign(const Function *F, Type *Ty, unsigned AttrIdx, const DataLayout &DL)
Alignment for a function parameter or return value at AttributeList index AttrIdx (FirstArgIndex + ar...
Function * getMaybeBitcastedCallee(const CallBase *CB)
unsigned getFromTypeWidthForLoad(const MemSDNode *Mem)
The bit-width of a single element loaded by Mem, i.e.
This struct is a compact representation of a valid (non-zero power of two) alignment.
EVT getVectorElementType() const
Given a vector type, return the type of each element.