LLVM 24.0.0git
RuntimeLibcalls.cpp
Go to the documentation of this file.
1//===- RuntimeLibcalls.cpp - Interface for runtime libcalls -----*- 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
11#include "llvm/IR/Intrinsics.h"
12#include "llvm/IR/Module.h"
14#include "llvm/IR/Type.h"
16
17#define DEBUG_TYPE "runtime-libcalls-info"
18
19using namespace llvm;
20using namespace RTLIB;
21
22#define GET_RUNTIME_LIBCALLS_INFO
23#define GET_INIT_RUNTIME_LIBCALL_NAMES
24#define GET_INIT_RUNTIME_LIBCALL_SIGNATURES
25#define GET_RUNTIME_LIBCALL_MASKED_VECTOR_LIBCALL_MAPPING
26#define GET_SET_TARGET_RUNTIME_LIBCALL_SETS
27#define DEFINE_GET_LOOKUP_LIBCALL_IMPL_NAME
28#define GET_RUNTIME_LIBCALL_INTRINSIC_TO_LIBCALL
29#include "llvm/IR/RuntimeLibcalls.inc"
30
31static RuntimeLibrary getVectorRuntimeLibrary(VectorLibrary VecLib) {
32 switch (VecLib) {
34 break;
36 return RuntimeLibrary::accelerate;
38 return RuntimeLibrary::darwin_libsystem_m;
40 return RuntimeLibrary::libmvec;
42 return RuntimeLibrary::massv;
44 return RuntimeLibrary::svml;
46 return RuntimeLibrary::sleefgnuabi;
48 return RuntimeLibrary::armpl;
50 return RuntimeLibrary::amdlibm;
51 }
52
53 llvm_unreachable("no RuntimeLibrary for VectorLibrary");
54}
55
57 const Triple &TT, ExceptionHandling ExceptionModel,
58 FloatABI::ABIType FloatABI, std::optional<LongDoubleFormat> LDblFormat,
59 StringRef ABIName, VectorLibrary VecLib)
60 : LongDoubleFmt(LDblFormat.value_or(TT.getDefaultLongDoubleFormat())) {
61 // Only an unspecified model resolves to the triple default; None is left as
62 // an explicit disable.
63 if (ExceptionModel == ExceptionHandling::Default)
64 ExceptionModel = TT.getDefaultExceptionHandling();
65
66 initLibcalls(TT, ExceptionModel, FloatABI, ABIName, LongDoubleFmt);
67
68 if (VecLib != VectorLibrary::NoLibrary) {
69 setAvailableLibraryLibcalls(getVectorRuntimeLibrary(VecLib), TT,
70 ExceptionModel, FloatABI, ABIName,
71 LongDoubleFmt);
72 }
73}
74
75// TODO: Consider the remaining module flags.
77 VectorLibrary VecLib)
78 : RuntimeLibcallsInfo(M.getTargetTriple(), M.getExceptionModel(),
79 M.getFloatABI(), M.getLongDoubleFormat(), ABIName,
80 VecLib) {}
81
82bool RuntimeLibcallsInfo::isLibraryAvailable(RuntimeLibrary Library) const {
83 // TODO: Drive this from module-level state (e.g. the linked runtime). For now
84 // every named library is reported as available.
85 return true;
86}
87
88/// Set default libcall names. If a target wants to opt-out of a libcall it
89/// should be placed here.
90void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
91 ExceptionHandling ExceptionModel,
93 StringRef ABIName,
95 setTargetRuntimeLibcallSets(TT, ExceptionModel, FloatABI, ABIName,
97}
98
101RuntimeLibcallsInfo::libcallImplNameHit(uint16_t NameOffsetEntry,
102 uint16_t StrOffset) {
103 int NumAliases = 1;
104 for (uint16_t Entry : ArrayRef(RuntimeLibcallNameOffsetTable)
105 .drop_front(NameOffsetEntry + 1)) {
106 if (Entry != StrOffset)
107 break;
108 ++NumAliases;
109 }
110
111 RTLIB::LibcallImpl ImplStart = static_cast<RTLIB::LibcallImpl>(
112 &RuntimeLibcallNameOffsetTable[NameOffsetEntry] -
113 &RuntimeLibcallNameOffsetTable[0]);
114 return enum_seq(ImplStart,
115 static_cast<RTLIB::LibcallImpl>(ImplStart + NumAliases));
116}
117
118bool RuntimeLibcallsInfo::isAAPCS_ABI(const Triple &TT, StringRef ABIName) {
119 const ARM::ARMABI TargetABI = ARM::computeTargetABI(TT, ABIName);
120 return TargetABI == ARM::ARM_ABI_AAPCS || TargetABI == ARM::ARM_ABI_AAPCS16;
121}
122
123/// TODO: There is really no guarantee that sizeof(size_t) is equal to the index
124/// size of the default address space. This matches TargetLibraryInfo and should
125/// be kept in sync.
127 return DL.getIndexType(Ctx, /*AddressSpace=*/0);
128}
129
130// TODO: NoCallback probably unsafe in general
131static constexpr Attribute::AttrKind CommonFnAttrs[] = {
132 Attribute::NoCallback, Attribute::NoFree, Attribute::NoSync,
133 Attribute::NoUnwind, Attribute::WillReturn};
134
136 switch (Format) {
138 return Type::getFloatTy(Ctx);
140 return Type::getDoubleTy(Ctx);
142 return Type::getX86_FP80Ty(Ctx);
144 return Type::getFP128Ty(Ctx);
146 return Type::getPPC_FP128Ty(Ctx);
147 }
148
149 llvm_unreachable("unhandled long double format");
150}
151
152static std::pair<Type *, Attribute>
153convertToIRTypeAndAttr(FuncArgTypeID ID, LLVMContext &Ctx, const DataLayout &DL,
154 unsigned IntBits, Type *LongDoubleTy) {
155
156 // FIXME: Use the llvm/ABI library to get accurate IR types and attributes.
157 switch (ID) {
158 case Void:
159 return {Type::getVoidTy(Ctx), Attribute()};
160 case Bool:
161 return {IntegerType::get(Ctx, 1), Attribute::get(Ctx, Attribute::ZExt)};
162 case Int16:
163 case UInt16:
164 return {IntegerType::get(Ctx, 16), Attribute()};
165 case Int32:
166 case UInt32:
167 return {IntegerType::get(Ctx, 32), Attribute()};
168 case Int:
169 case UInt:
170 case IntPlus:
171 case UIntPlus:
172 case Long:
173 case ULong:
174 case IntX:
175 case UIntX:
176 return {IntegerType::get(Ctx, IntBits), Attribute()};
177 case Int64:
178 case UInt64:
179 case LLong:
180 case ULLong:
181 return {IntegerType::get(Ctx, 64), Attribute()};
182 case SizeT:
183 case SSizeT:
184 return {getSizeTType(Ctx, DL), Attribute()};
185 case Flt:
186 case Floating:
187 return {Type::getFloatTy(Ctx), Attribute()};
188 case Dbl:
189 return {Type::getDoubleTy(Ctx), Attribute()};
190 case LDbl:
191 return {LongDoubleTy, Attribute()};
192 case Ptr:
193 return {PointerType::get(Ctx, 0), Attribute()};
194 case V2F32:
196 case V4F32:
198 case V8F32:
200 case V16F32:
201 return {FixedVectorType::get(Type::getFloatTy(Ctx), 16), Attribute()};
202 case NXV4F32:
204 case V2F64:
206 case V4F64:
208 case V8F64:
210 case NXV2F64:
212 case NXV2I1:
214 case NXV4I1:
216 case V2I32:
218 case V4I32:
220 case V8I32:
222 case V16I32:
223 return {FixedVectorType::get(Type::getInt32Ty(Ctx), 16), Attribute()};
224 case NXV2I32:
226 case NXV4I32:
228 default:
229 return {};
230 }
231}
232
233std::pair<FunctionType *, AttributeList>
235 LLVMContext &Ctx, const Triple &TT, const DataLayout &DL,
236 RTLIB::LibcallImpl LibcallImpl) const {
237 Libcall LC = getLibcallFromImpl(LibcallImpl);
238 const FuncArgTypeID *ProtoTypes = &SignatureTable[SignatureOffset[LC]];
239
240 if (ProtoTypes[0] == NoFuncArgType)
241 return {};
242
243 unsigned IntBits = getIntSize(TT);
244 Type *LongDoubleTy = getLongDoubleType(Ctx, LongDoubleFmt);
245 AttributeList Attrs;
246
247 auto [RetTy, RetAttr] =
248 convertToIRTypeAndAttr(ProtoTypes[0], Ctx, DL, IntBits, LongDoubleTy);
249 if (RetAttr.isValid())
250 Attrs = Attrs.addRetAttribute(Ctx, RetAttr);
251
252 Type *LastTy = RetTy, *ArgTy;
253 Attribute LastAttr = RetAttr, ArgAttr;
255 bool IsVarArg = false;
256 unsigned Idx = 1;
257 for (FuncArgTypeID TyID = ProtoTypes[Idx]; TyID != NoFuncArgType;
258 TyID = ProtoTypes[++Idx]) {
259 if (TyID == Ellip) {
260 // The ellipsis ends the protoype list so it must be followed by
261 // NoFuncArgType.
262 assert(ProtoTypes[Idx + 1] == NoFuncArgType);
263 IsVarArg = true;
264 break;
265 }
266
267 if (TyID == Same) {
268 ArgTy = LastTy;
269 ArgAttr = LastAttr;
270 } else {
271 std::tie(ArgTy, ArgAttr) = convertToIRTypeAndAttr(
272 ProtoTypes[Idx], Ctx, DL, IntBits, LongDoubleTy);
273 LastTy = ArgTy;
274 LastAttr = ArgAttr;
275 }
276
277 ArgTys.push_back(ArgTy);
278 if (ArgAttr.isValid())
279 Attrs = Attrs.addParamAttribute(Ctx, Idx - 1, ArgAttr);
280 }
281
282 if (RetTy->isVectorTy()) {
283 AttrBuilder FuncAttrBuilder(Ctx);
285 FuncAttrBuilder.addAttribute(Attr);
286 Attrs = Attrs.addFnAttributes(Ctx, FuncAttrBuilder);
287 }
288
289 return {FunctionType::get(RetTy, ArgTys, IsVarArg), Attrs};
290}
291
292std::pair<FunctionType *, AttributeList>
294 const DataLayout &DL,
295 RTLIB::LibcallImpl LibcallImpl) const {
296 static constexpr Attribute::AttrKind MemoryFnAttrs[] = {
297 Attribute::NoUnwind, Attribute::WillReturn};
298 static constexpr Attribute::AttrKind CommonPtrArgAttrs[] = {
299 Attribute::NoAlias, Attribute::WriteOnly, Attribute::NonNull};
300
301 switch (LibcallImpl) {
302 case RTLIB::impl___sincos_stret:
303 case RTLIB::impl___sincosf_stret: {
304 if (!darwinHasSinCosStret(TT)) // Non-darwin currently unexpected
305 return {};
306
307 Type *ScalarTy = LibcallImpl == RTLIB::impl___sincosf_stret
308 ? Type::getFloatTy(Ctx)
309 : Type::getDoubleTy(Ctx);
310
311 AttrBuilder FuncAttrBuilder(Ctx);
313 FuncAttrBuilder.addAttribute(Attr);
314
315 const bool UseSret =
316 TT.isX86_32() || ((TT.isARM() || TT.isThumb()) &&
318
319 FuncAttrBuilder.addMemoryAttr(MemoryEffects::argumentOrErrnoMemOnly(
321
322 AttributeList Attrs;
323 Attrs = Attrs.addFnAttributes(Ctx, FuncAttrBuilder);
324
325 if (UseSret) {
326 AttrBuilder AttrBuilder(Ctx);
327 StructType *StructTy = StructType::get(ScalarTy, ScalarTy);
328 AttrBuilder.addStructRetAttr(StructTy);
329 AttrBuilder.addAlignmentAttr(DL.getABITypeAlign(StructTy));
331 Type::getVoidTy(Ctx), {DL.getAllocaPtrType(Ctx), ScalarTy}, false);
332
333 return {FuncTy, Attrs.addParamAttributes(Ctx, 0, AttrBuilder)};
334 }
335
336 Type *RetTy =
337 LibcallImpl == RTLIB::impl___sincosf_stret && TT.isX86_64()
338 ? static_cast<Type *>(FixedVectorType::get(ScalarTy, 2))
339 : static_cast<Type *>(StructType::get(ScalarTy, ScalarTy));
340
341 return {FunctionType::get(RetTy, {ScalarTy}, false), Attrs};
342 }
343 case RTLIB::impl_malloc:
344 case RTLIB::impl_calloc: {
345 AttrBuilder FuncAttrBuilder(Ctx);
346 for (Attribute::AttrKind Attr : MemoryFnAttrs)
347 FuncAttrBuilder.addAttribute(Attr);
348 FuncAttrBuilder.addAttribute(Attribute::NoFree);
349
351 if (LibcallImpl == RTLIB::impl_malloc)
352 AllocKind |= AllocFnKind::Uninitialized;
353
354 // TODO: Set memory attribute
355 FuncAttrBuilder.addAllocKindAttr(AllocKind);
356 FuncAttrBuilder.addAttribute("alloc-family", "malloc");
357 FuncAttrBuilder.addAllocSizeAttr(0, LibcallImpl == RTLIB::impl_malloc
358 ? std::nullopt
359 : std::make_optional(1));
360
361 AttributeList Attrs;
362 Attrs = Attrs.addFnAttributes(Ctx, FuncAttrBuilder);
363
364 {
365 AttrBuilder ArgAttrBuilder(Ctx);
366 for (Attribute::AttrKind AK : CommonPtrArgAttrs)
367 ArgAttrBuilder.addAttribute(AK);
368
369 Attrs = Attrs.addRetAttribute(Ctx, Attribute::NoUndef);
370 Attrs = Attrs.addRetAttribute(Ctx, Attribute::NoAlias);
371 Attrs = Attrs.addParamAttribute(Ctx, 0, Attribute::NoUndef);
372 if (LibcallImpl == RTLIB::impl_calloc)
373 Attrs = Attrs.addParamAttribute(Ctx, 1, Attribute::NoUndef);
374 }
375
376 IntegerType *SizeT = getSizeTType(Ctx, DL);
377 PointerType *PtrTy = PointerType::get(Ctx, 0);
378 SmallVector<Type *, 2> ArgTys = {SizeT};
379 if (LibcallImpl == RTLIB::impl_calloc)
380 ArgTys.push_back(SizeT);
381
382 return {FunctionType::get(PtrTy, ArgTys, false), Attrs};
383 }
384 case RTLIB::impl_free: {
385 // TODO: Set memory attribute
386 AttrBuilder FuncAttrBuilder(Ctx);
387 for (Attribute::AttrKind Attr : MemoryFnAttrs)
388 FuncAttrBuilder.addAttribute(Attr);
389
390 FuncAttrBuilder.addAllocKindAttr(AllocFnKind::Free);
391 FuncAttrBuilder.addAttribute("alloc-family", "malloc");
392
393 AttributeList Attrs;
394 Attrs = Attrs.addFnAttributes(Ctx, FuncAttrBuilder);
395
396 {
397 AttrBuilder ArgAttrBuilder(Ctx);
398 ArgAttrBuilder.addAttribute(Attribute::NoUndef);
399 ArgAttrBuilder.addAttribute(Attribute::AllocatedPointer);
400 ArgAttrBuilder.addCapturesAttr(CaptureInfo::none());
401 Attrs = Attrs.addParamAttributes(Ctx, 0, ArgAttrBuilder);
402 }
403
404 return {FunctionType::get(Type::getVoidTy(Ctx), {PointerType::get(Ctx, 0)},
405 false),
406 Attrs};
407 }
408 case RTLIB::impl___aeabi_idivmod:
409 case RTLIB::impl___aeabi_uidivmod:
410 case RTLIB::impl___aeabi_ldivmod:
411 case RTLIB::impl___aeabi_uldivmod:
412 case RTLIB::impl___rt_sdiv:
413 case RTLIB::impl___rt_udiv:
414 case RTLIB::impl___rt_sdiv64:
415 case RTLIB::impl___rt_udiv64: {
416 // The ARM AEABI (__aeabi_*divmod) and Windows (__rt_*div*) divmod functions
417 // return both values modeled as an inreg { iN, iN } struct (quotient,
418 // remainder). The __rt_*div* cases pass the arguments in opposite order,
419 // though this doesn't affect the declaration.
420 bool IsSigned;
421 unsigned Bits;
422 switch (LibcallImpl) {
423 case RTLIB::impl___aeabi_idivmod:
424 case RTLIB::impl___rt_sdiv:
425 IsSigned = true;
426 Bits = 32;
427 break;
428 case RTLIB::impl___aeabi_uidivmod:
429 case RTLIB::impl___rt_udiv:
430 IsSigned = false;
431 Bits = 32;
432 break;
433 case RTLIB::impl___aeabi_ldivmod:
434 case RTLIB::impl___rt_sdiv64:
435 IsSigned = true;
436 Bits = 64;
437 break;
438 case RTLIB::impl___aeabi_uldivmod:
439 case RTLIB::impl___rt_udiv64:
440 IsSigned = false;
441 Bits = 64;
442 break;
443 default:
444 llvm_unreachable("unexpected divmod libcall");
445 }
446
447 Type *IntTy = IntegerType::get(Ctx, Bits);
448 StructType *RetTy = StructType::get(IntTy, IntTy);
449 FunctionType *FuncTy = FunctionType::get(RetTy, {IntTy, IntTy}, false);
450
451 AttrBuilder FuncAttrBuilder(Ctx);
453 FuncAttrBuilder.addAttribute(Attr);
454 FuncAttrBuilder.addMemoryAttr(MemoryEffects::none());
455
456 AttributeList Attrs;
457 Attrs = Attrs.addFnAttributes(Ctx, FuncAttrBuilder);
458
459 Attribute::AttrKind ExtKind = IsSigned ? Attribute::SExt : Attribute::ZExt;
460 Attrs = Attrs.addRetAttribute(Ctx, Attribute::InReg);
461 Attrs = Attrs.addParamAttribute(Ctx, 0, ExtKind);
462 Attrs = Attrs.addParamAttribute(Ctx, 1, ExtKind);
463
464 return {FuncTy, Attrs};
465 }
466 case RTLIB::impl_sqrtf:
467 case RTLIB::impl_sqrt: {
468 AttrBuilder FuncAttrBuilder(Ctx);
469
471 FuncAttrBuilder.addAttribute(Attr);
472 FuncAttrBuilder.addMemoryAttr(MemoryEffects::errnoMemOnly(ModRefInfo::Mod));
473
474 AttributeList Attrs;
475 Attrs = Attrs.addFnAttributes(Ctx, FuncAttrBuilder);
476
477 Type *ScalarTy = LibcallImpl == RTLIB::impl_sqrtf ? Type::getFloatTy(Ctx)
478 : Type::getDoubleTy(Ctx);
479 FunctionType *FuncTy = FunctionType::get(ScalarTy, {ScalarTy}, false);
480
481 Attrs = Attrs.addRetAttribute(
483 fcNegNormal));
484 return {FuncTy, Attrs};
485 }
486 default:
487 break;
488 }
489
490 auto [FuncTy, Attrs] = getDefaultFunctionTy(Ctx, TT, DL, LibcallImpl);
491 if (!FuncTy || FuncTy->getNumParams() == 0 ||
492 !FuncTy->getParamType(0)->isVectorTy())
493 return {FuncTy, Attrs};
494
495 Type *VecTy = FuncTy->getParamType(0);
496 AttrBuilder ArgAttrBuilder(Ctx);
497 for (Attribute::AttrKind AK : CommonPtrArgAttrs)
498 ArgAttrBuilder.addAttribute(AK);
499 ArgAttrBuilder.addAlignmentAttr(DL.getABITypeAlign(VecTy));
500
501 bool HasPtrArg = false;
502 for (auto [Idx, ParamTy] : enumerate(FuncTy->params())) {
503 if (ParamTy->isPointerTy()) {
504 Attrs = Attrs.addParamAttributes(Ctx, Idx, ArgAttrBuilder);
505 HasPtrArg = true;
506 }
507 }
508
509 if (HasPtrArg) {
510 AttrBuilder FuncAttrBuilder(Ctx);
512 FuncAttrBuilder.addAttribute(Attr);
513 FuncAttrBuilder.addMemoryAttr(MemoryEffects::argMemOnly(ModRefInfo::Mod));
514 Attrs = Attrs.addFnAttributes(Ctx, FuncAttrBuilder);
515 }
516
517 return {FuncTy, Attrs};
518}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
constexpr LLT V2F32
constexpr LLT V2F64
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
@ RetAttr
#define LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_ALWAYS_INLINE - On compilers where we have a directive to do so, mark a method "always...
Definition Compiler.h:368
Utilities for dealing with flags related to floating point properties and mode controls.
Module.h This file contains the declarations for the Module class.
static Type * getLongDoubleType(LLVMContext &Ctx, LongDoubleFormat Format)
static IntegerType * getSizeTType(LLVMContext &Ctx, const DataLayout &DL)
TODO: There is really no guarantee that sizeof(size_t) is equal to the index size of the default addr...
static RuntimeLibrary getVectorRuntimeLibrary(VectorLibrary VecLib)
static std::pair< Type *, Attribute > convertToIRTypeAndAttr(FuncArgTypeID ID, LLVMContext &Ctx, const DataLayout &DL, unsigned IntBits, Type *LongDoubleTy)
static constexpr Attribute::AttrKind CommonFnAttrs[]
Functions, function parameters, and return types can have attributes to indicate how they should be t...
Definition Attributes.h:106
static LLVM_ABI Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val=0)
Return a uniquified Attribute object.
static LLVM_ABI Attribute getWithNoFPClass(LLVMContext &Context, FPClassTest Mask)
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results,...
Definition Attributes.h:125
static CaptureInfo none()
Create CaptureInfo that does not capture any components of the pointer.
Definition ModRef.h:427
A parsed version of the target data layout string in and methods for querying it.
Definition DataLayout.h:64
static LLVM_ABI FixedVectorType * get(Type *ElementType, unsigned NumElts)
Definition Type.cpp:843
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.
Class to represent integer types.
static LLVM_ABI IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
Definition Type.cpp:338
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:76
static MemoryEffectsBase argMemOnly(ModRefInfo MR=ModRefInfo::ModRef)
Definition ModRef.h:143
static MemoryEffectsBase errnoMemOnly(ModRefInfo MR=ModRefInfo::ModRef)
Definition ModRef.h:154
static MemoryEffectsBase argumentOrErrnoMemOnly(ModRefInfo ArgMR=ModRefInfo::ModRef, ModRefInfo ErrnoMR=ModRefInfo::ModRef)
Definition ModRef.h:198
static MemoryEffectsBase none()
Definition ModRef.h:128
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
Class to represent pointers.
static LLVM_ABI PointerType * get(LLVMContext &C, unsigned AddressSpace)
This constructs an opaque pointer to an object in a numbered address space.
Definition Type.cpp:887
static LLVM_ABI ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
Definition Type.cpp:865
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.
Definition StringRef.h:56
Class to represent struct types.
static LLVM_ABI StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
Definition Type.cpp:467
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
Definition Type.cpp:299
static LLVM_ABI Type * getPPC_FP128Ty(LLVMContext &C)
Definition Type.cpp:282
static LLVM_ABI Type * getFP128Ty(LLVMContext &C)
Definition Type.cpp:281
static LLVM_ABI Type * getVoidTy(LLVMContext &C)
Definition Type.cpp:272
static LLVM_ABI IntegerType * getInt1Ty(LLVMContext &C)
Definition Type.cpp:296
static LLVM_ABI Type * getDoubleTy(LLVMContext &C)
Definition Type.cpp:277
static LLVM_ABI Type * getX86_FP80Ty(LLVMContext &C)
Definition Type.cpp:280
static LLVM_ABI Type * getFloatTy(LLVMContext &C)
Definition Type.cpp:276
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI LLVM_READONLY ARMABI computeTargetABI(const Triple &TT, StringRef ABIName="")
This is an optimization pass for GlobalISel generic memory operations.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
Definition STLExtras.h:2570
AllocFnKind
Definition Attributes.h:54
LongDoubleFormat
The floating-point format used for the target's "long double" type.
Definition CodeGen.h:117
constexpr auto enum_seq(EnumT Begin, EnumT End)
Iterate over an enum type from Begin up to - but not including - End.
Definition Sequence.h:373
@ Mod
The access may modify the value stored in memory.
Definition ModRef.h:34
@ NoModRef
The access neither references nor modifies the value stored in memory.
Definition ModRef.h:30
ArrayRef(const T &OneElt) -> ArrayRef< T >
ExceptionHandling
Definition CodeGen.h:54
@ Default
Not specified; resolve to the target's default model.
Definition CodeGen.h:55
VectorLibrary
List of known vector-functions libraries.
LLVM_ABI std::pair< FunctionType *, AttributeList > getFunctionTy(LLVMContext &Ctx, const Triple &TT, const DataLayout &DL, RTLIB::LibcallImpl LibcallImpl) const
unsigned getIntSize(const Triple &TT) const
Get size of a C-level int or unsigned int, in bits.
LLVM_ABI std::pair< FunctionType *, AttributeList > getDefaultFunctionTy(LLVMContext &Ctx, const Triple &TT, const DataLayout &DL, RTLIB::LibcallImpl LibcallImpl) const
Get the C-type function signature of the Libcall if provided, and convert it to IR FunctionType and A...
static RTLIB::Libcall getLibcallFromImpl(RTLIB::LibcallImpl Impl)
Return the libcall provided by Impl.