Go to the documentation of this file.
35 #include "llvm/IR/IntrinsicsAArch64.h"
36 #include "llvm/IR/IntrinsicsAMDGPU.h"
37 #include "llvm/IR/IntrinsicsARM.h"
38 #include "llvm/IR/IntrinsicsBPF.h"
39 #include "llvm/IR/IntrinsicsHexagon.h"
40 #include "llvm/IR/IntrinsicsMips.h"
41 #include "llvm/IR/IntrinsicsNVPTX.h"
42 #include "llvm/IR/IntrinsicsPowerPC.h"
43 #include "llvm/IR/IntrinsicsR600.h"
44 #include "llvm/IR/IntrinsicsRISCV.h"
45 #include "llvm/IR/IntrinsicsS390.h"
46 #include "llvm/IR/IntrinsicsVE.h"
47 #include "llvm/IR/IntrinsicsWebAssembly.h"
48 #include "llvm/IR/IntrinsicsX86.h"
49 #include "llvm/IR/IntrinsicsXCore.h"
80 cl::desc(
"Maximum size for the name of non-global values."));
87 :
Value(Ty,
Value::ArgumentVal), Parent(Par), ArgNo(ArgNo) {
91 void Argument::setParent(
Function *parent) {
96 if (!
getType()->isPointerTy())
return false;
98 (AllowUndefOrPoison ||
103 getType()->getPointerAddressSpace()))
109 if (!
getType()->isPointerTy())
return false;
128 if (!
getType()->isPointerTy())
return false;
139 if (!
getType()->isPointerTy())
return false;
180 return DL.getTypeAllocSize(MemTy);
191 assert(
getType()->isPointerTy() &&
"Only pointers have alignments");
196 assert(
getType()->isPointerTy() &&
"Only pointers have alignments");
205 assert(
getType()->isPointerTy() &&
"Only pointers have byval types");
210 assert(
getType()->isPointerTy() &&
"Only pointers have sret types");
215 assert(
getType()->isPointerTy() &&
"Only pointers have byref types");
220 assert(
getType()->isPointerTy() &&
"Only pointers have inalloca types");
226 "Only pointers have dereferenceable bytes");
232 "Only pointers have dereferenceable bytes");
237 if (!
getType()->isPointerTy())
return false;
242 if (!
getType()->isPointerTy())
return false;
247 if (!
getType()->isPointerTy())
return false;
252 if (!
getType()->isPointerTy())
return false;
257 if (!
getType()->isPointerTy())
return false;
279 return Attrs.hasParamAttr(
getArgNo(), Attribute::ReadOnly) ||
324 unsigned NumInstrs = 0;
326 NumInstrs += std::distance(
BB.instructionsWithoutDebug().begin(),
327 BB.instructionsWithoutDebug().end());
333 return Create(Ty,
Linkage,
M.getDataLayout().getProgramAddressSpace(),
N, &
M);
338 unsigned AddrSpace,
const Twine &
N,
344 B.addUWTableAttr(UWTable);
345 switch (
M->getFramePointer()) {
350 B.addAttribute(
"frame-pointer",
"non-leaf");
353 B.addAttribute(
"frame-pointer",
"all");
375 if (AddrSpace ==
static_cast<unsigned>(-1))
376 return M ?
M->getDataLayout().getProgramAddressSpace() : 0;
380 Function::Function(
FunctionType *Ty, LinkageTypes Linkage,
unsigned AddrSpace,
385 NumArgs(Ty->getNumParams()) {
386 assert(FunctionType::isValidReturnType(getReturnType()) &&
387 "invalid return type");
388 setGlobalObjectSubClassData(0);
391 if (!getContext().shouldDiscardValueNames())
396 setValueSubclassData(1);
409 Function::~Function() {
420 void Function::BuildLazyArguments()
const {
424 Arguments = std::allocator<Argument>().allocate(NumArgs);
425 for (
unsigned i = 0,
e = NumArgs;
i !=
e; ++
i) {
426 Type *ArgTy = FT->getParamType(
i);
427 assert(!ArgTy->
isVoidTy() &&
"Cannot have void typed arguments!");
435 const_cast<Function*
>(
this)->setValueSubclassData(SDC);
445 #define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \
446 case Intrinsic::INTRINSIC:
447 #include "llvm/IR/ConstrainedOps.def"
455 void Function::clearArguments() {
460 std::allocator<Argument>().deallocate(Arguments, NumArgs);
470 [](
const Argument &A) {
return A.use_empty(); }) &&
471 "Expected arguments to be unused in declaration");
477 if (Src.hasLazyArguments())
482 Arguments = Src.Arguments;
483 Src.Arguments =
nullptr;
498 Src.setValueSubclassData(Src.getSubclassDataFromValue() | (1 << 0));
513 BB.dropAllReferences();
517 while (!BasicBlocks.empty())
518 BasicBlocks.begin()->eraseFromParent();
692 setValueSubclassDataBit(14, !Str.empty());
700 setValueSubclassDataBit(14,
false);
719 if (Src->hasPersonalityFn())
721 if (Src->hasPrefixData())
723 if (Src->hasPrologueData())
730 #define GET_INTRINSIC_NAME_TABLE
731 #include "llvm/IR/IntrinsicImpl.inc"
732 #undef GET_INTRINSIC_NAME_TABLE
736 #define GET_INTRINSIC_TARGET_DATA
737 #include "llvm/IR/IntrinsicImpl.inc"
738 #undef GET_INTRINSIC_TARGET_DATA
741 return IID > TargetInfos[0].Count;
760 Targets, [=](
const IntrinsicTargetInfo &TI) {
return TI.Name <
Target; });
763 const auto &TI = It != Targets.
end() && It->Name ==
Target ? *It : Targets[0];
782 const auto MatchSize = strlen(NameTable[Idx]);
783 assert(
Name.size() >= MatchSize &&
"Expected either exact or prefix match");
784 bool IsExactMatch =
Name.size() == MatchSize;
791 if (!
Name.startswith(
"llvm.")) {
814 if (
PointerType *PTyp = dyn_cast<PointerType>(Ty)) {
815 Result +=
"p" + utostr(PTyp->getAddressSpace());
818 if (!PTyp->isOpaque())
821 }
else if (
ArrayType *ATyp = dyn_cast<ArrayType>(Ty)) {
822 Result +=
"a" + utostr(ATyp->getNumElements()) +
824 }
else if (
StructType *STyp = dyn_cast<StructType>(Ty)) {
825 if (!STyp->isLiteral()) {
828 Result += STyp->getName();
830 HasUnnamedType =
true;
833 for (
auto Elem : STyp->elements())
838 }
else if (
FunctionType *FT = dyn_cast<FunctionType>(Ty)) {
840 for (
size_t i = 0;
i < FT->getNumParams();
i++)
846 }
else if (
VectorType *VTy = dyn_cast<VectorType>(Ty)) {
850 Result +=
"v" + utostr(EC.getKnownMinValue()) +
867 Result +=
"i" + utostr(cast<IntegerType>(Ty)->
getBitWidth());
875 assert(
id < num_intrinsics &&
"Invalid intrinsic ID!");
880 assert(
id < num_intrinsics &&
"Invalid intrinsic ID!");
882 "This version of getName does not support overloading");
888 bool EarlyModuleCheck) {
890 assert(
Id < Intrinsic::num_intrinsics &&
"Invalid intrinsic ID!");
892 "This version of getName is for overloaded intrinsics only");
893 (void)EarlyModuleCheck;
894 assert((!EarlyModuleCheck ||
M ||
895 !
any_of(Tys, [](
Type *
T) {
return isa<PointerType>(
T); })) &&
896 "Intrinsic overloading on pointer types need to provide a Module");
897 bool HasUnnamedType =
false;
901 if (HasUnnamedType) {
902 assert(
M &&
"unnamed types need a module");
907 "Provided FunctionType must match arguments");
908 return M->getUniqueIntrinsicName(Result,
Id, FT);
915 assert(
M &&
"We need to have a Module");
993 using namespace Intrinsic;
998 unsigned StructElts = 2;
1122 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1127 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1133 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1139 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1145 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1151 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1157 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1162 unsigned short ArgNo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1163 unsigned short RefNo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1164 OutputTable.push_back(
1169 unsigned short ArgNo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1170 unsigned short RefNo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1171 OutputTable.push_back(
1188 for (
unsigned i = 0;
i != StructElts; ++
i)
1193 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1199 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1205 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1215 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
1224 #define GET_INTRINSIC_GENERATOR_GLOBAL
1225 #include "llvm/IR/IntrinsicImpl.inc"
1226 #undef GET_INTRINSIC_GENERATOR_GLOBAL
1231 unsigned TableVal = IIT_Table[
id-1];
1236 unsigned NextElt = 0;
1237 if ((TableVal >> 31) != 0) {
1239 IITEntries = IIT_LongEncodingTable;
1242 NextElt = (TableVal << 1) >> 1;
1247 IITValues.push_back(TableVal & 0xF);
1251 IITEntries = IITValues;
1257 while (NextElt != IITEntries.
size() && IITEntries[NextElt] != 0)
1263 using namespace Intrinsic;
1265 IITDescriptor
D = Infos.
front();
1266 Infos = Infos.
slice(1);
1289 D.Pointer_AddressSpace);
1292 for (
unsigned i = 0,
e =
D.Struct_NumElements;
i !=
e; ++
i)
1297 return Tys[
D.getArgumentNumber()];
1299 Type *Ty = Tys[
D.getArgumentNumber()];
1300 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
1306 Type *Ty = Tys[
D.getArgumentNumber()];
1307 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
1316 Type *Ty = Tys[
D.getArgumentNumber()];
1318 assert(VTy &&
"Expected an argument of Vector Type");
1324 Tys[
D.getArgumentNumber()]));
1327 Type *Ty = Tys[
D.getArgumentNumber()];
1328 if (
auto *VTy = dyn_cast<VectorType>(Ty))
1333 Type *Ty = Tys[
D.getArgumentNumber()];
1337 Type *Ty = Tys[
D.getArgumentNumber()];
1345 Type *Ty = Tys[
D.getArgumentNumber()];
1346 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
1347 return VTy->getElementType();
1351 Type *Ty = Tys[
D.getArgumentNumber()];
1353 assert(VTy &&
"Expected an argument of Vector Type");
1358 return Tys[
D.getOverloadArgNumber()];
1361 return Tys[
D.getOverloadArgNumber()];
1380 if (!ArgTys.empty() && ArgTys.back()->isVoidTy()) {
1388 #define GET_INTRINSIC_OVERLOAD_TABLE
1389 #include "llvm/IR/IntrinsicImpl.inc"
1390 #undef GET_INTRINSIC_OVERLOAD_TABLE
1398 case Intrinsic::experimental_gc_statepoint:
1399 case Intrinsic::experimental_patchpoint_void:
1400 case Intrinsic::experimental_patchpoint_i64:
1406 #define GET_INTRINSIC_ATTRIBUTES
1407 #include "llvm/IR/IntrinsicImpl.inc"
1408 #undef GET_INTRINSIC_ATTRIBUTES
1413 auto *FT =
getType(
M->getContext(),
id, Tys);
1414 return cast<Function>(
1422 #define GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
1423 #include "llvm/IR/IntrinsicImpl.inc"
1424 #undef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
1427 #define GET_LLVM_INTRINSIC_FOR_MS_BUILTIN
1428 #include "llvm/IR/IntrinsicImpl.inc"
1429 #undef GET_LLVM_INTRINSIC_FOR_MS_BUILTIN
1432 std::pair<Type *, ArrayRef<Intrinsic::IITDescriptor>>;
1438 bool IsDeferredCheck) {
1439 using namespace Intrinsic;
1442 if (Infos.
empty())
return true;
1445 auto InfosRef = Infos;
1446 auto DeferCheck = [&DeferredChecks, &InfosRef](
Type *
T) {
1451 IITDescriptor
D = Infos.
front();
1452 Infos = Infos.
slice(1);
1472 DeferredChecks, IsDeferredCheck);
1485 Infos = Infos.
slice(1);
1489 ArgTys, DeferredChecks, IsDeferredCheck);
1497 Infos = Infos.
slice(1);
1500 "Unsupported polymorphic pointer type with opaque pointer");
1501 Infos = Infos.
slice(1);
1507 if (!
ST || !
ST->isLiteral() ||
ST->isPacked() ||
1508 ST->getNumElements() !=
D.Struct_NumElements)
1511 for (
unsigned i = 0,
e =
D.Struct_NumElements;
i !=
e; ++
i)
1513 DeferredChecks, IsDeferredCheck))
1521 if (
D.getArgumentNumber() < ArgTys.size())
1522 return Ty != ArgTys[
D.getArgumentNumber()];
1524 if (
D.getArgumentNumber() > ArgTys.size() ||
1526 return IsDeferredCheck || DeferCheck(Ty);
1528 assert(
D.getArgumentNumber() == ArgTys.size() && !IsDeferredCheck &&
1529 "Table consistency error");
1530 ArgTys.push_back(Ty);
1532 switch (
D.getArgumentKind()) {
1544 if (
D.getArgumentNumber() >= ArgTys.size())
1545 return IsDeferredCheck || DeferCheck(Ty);
1547 Type *NewTy = ArgTys[
D.getArgumentNumber()];
1548 if (
VectorType *VTy = dyn_cast<VectorType>(NewTy))
1550 else if (
IntegerType *ITy = dyn_cast<IntegerType>(NewTy))
1559 if (
D.getArgumentNumber() >= ArgTys.size())
1560 return IsDeferredCheck || DeferCheck(Ty);
1562 Type *NewTy = ArgTys[
D.getArgumentNumber()];
1563 if (
VectorType *VTy = dyn_cast<VectorType>(NewTy))
1565 else if (
IntegerType *ITy = dyn_cast<IntegerType>(NewTy))
1574 if (
D.getArgumentNumber() >= ArgTys.size())
1575 return IsDeferredCheck || DeferCheck(Ty);
1576 return !isa<VectorType>(ArgTys[
D.getArgumentNumber()]) ||
1578 cast<VectorType>(ArgTys[
D.getArgumentNumber()])) != Ty;
1580 if (
D.getArgumentNumber() >= ArgTys.size()) {
1582 Infos = Infos.
slice(1);
1583 return IsDeferredCheck || DeferCheck(Ty);
1585 auto *
ReferenceType = dyn_cast<VectorType>(ArgTys[
D.getArgumentNumber()]);
1586 auto *ThisArgType = dyn_cast<VectorType>(Ty);
1593 ThisArgType->getElementCount())
1595 EltTy = ThisArgType->getElementType();
1601 if (
D.getArgumentNumber() >= ArgTys.size())
1602 return IsDeferredCheck || DeferCheck(Ty);
1604 PointerType *ThisArgType = dyn_cast<PointerType>(Ty);
1605 return (!ThisArgType ||
1609 if (
D.getArgumentNumber() >= ArgTys.size())
1610 return IsDeferredCheck || DeferCheck(Ty);
1612 dyn_cast<VectorType> (ArgTys[
D.getArgumentNumber()]);
1613 PointerType *ThisArgType = dyn_cast<PointerType>(Ty);
1621 unsigned RefArgNumber =
D.getRefArgNumber();
1622 if (RefArgNumber >= ArgTys.size()) {
1623 if (IsDeferredCheck)
1627 ArgTys.push_back(Ty);
1628 return DeferCheck(Ty);
1631 if (!IsDeferredCheck) {
1632 assert(
D.getOverloadArgNumber() == ArgTys.size() &&
1633 "Table consistency error");
1634 ArgTys.push_back(Ty);
1637 auto *
ReferenceType = dyn_cast<VectorType>(ArgTys[RefArgNumber]);
1638 auto *ThisArgType = dyn_cast<PointerType>(Ty);
1641 return !ThisArgType->isOpaqueOrPointeeTypeMatches(
1645 unsigned RefArgNumber =
D.getRefArgNumber();
1646 if (RefArgNumber >= ArgTys.size()) {
1647 if (IsDeferredCheck)
1651 ArgTys.push_back(Ty);
1652 return DeferCheck(Ty);
1655 if (!IsDeferredCheck){
1656 assert(
D.getOverloadArgNumber() == ArgTys.size() &&
1657 "Table consistency error");
1658 ArgTys.push_back(Ty);
1664 auto *
ReferenceType = dyn_cast<VectorType>(ArgTys[RefArgNumber]);
1665 auto *ThisArgVecTy = dyn_cast<VectorType>(Ty);
1667 (
ReferenceType->getElementCount() != ThisArgVecTy->getElementCount()))
1670 dyn_cast<PointerType>(ThisArgVecTy->getElementType());
1677 if (
D.getArgumentNumber() >= ArgTys.size())
1678 return IsDeferredCheck ?
true : DeferCheck(Ty);
1679 auto *
ReferenceType = dyn_cast<VectorType>(ArgTys[
D.getArgumentNumber()]);
1685 if (
D.getArgumentNumber() >= ArgTys.size())
1686 return IsDeferredCheck || DeferCheck(Ty);
1688 Type *NewTy = ArgTys[
D.getArgumentNumber()];
1689 if (
auto *VTy = dyn_cast<VectorType>(NewTy)) {
1697 if (
D.getArgumentNumber() >= ArgTys.size())
1698 return IsDeferredCheck || DeferCheck(Ty);
1699 auto *
ReferenceType = dyn_cast<VectorType>(ArgTys[
D.getArgumentNumber()]);
1700 auto *ThisArgVecTy = dyn_cast<VectorType>(Ty);
1718 unsigned NumDeferredReturnChecks = DeferredChecks.size();
1720 for (
auto Ty : FTy->
params())
1724 for (
unsigned I = 0,
E = DeferredChecks.size();
I !=
E; ++
I) {
1743 if (Infos.
size() != 1)
1748 Infos = Infos.
slice(1);
1749 if (
D.Kind == IITDescriptor::VarArg)
1783 std::string WantedName =
1785 if (
Name == WantedName)
1789 if (
auto *ExistingGV =
F->getParent()->getNamedValue(WantedName)) {
1790 if (
auto *ExistingF = dyn_cast<Function>(ExistingGV))
1791 if (ExistingF->getFunctionType() ==
F->getFunctionType())
1798 ExistingGV->
setName(WantedName +
".renamed");
1805 "Shouldn't change the signature");
1814 bool IgnoreCallbackUses,
1815 bool IgnoreAssumeLikeCalls,
bool IgnoreLLVMUsed,
1816 bool IgnoreARCAttachedCall)
const {
1818 const User *FU = U.getUser();
1819 if (isa<BlockAddress>(FU))
1822 if (IgnoreCallbackUses) {
1828 const auto *Call = dyn_cast<CallBase>(FU);
1830 if (IgnoreAssumeLikeCalls) {
1831 if (
const auto *FI = dyn_cast<Instruction>(FU)) {
1832 if (FI->isCast() && !FI->user_empty() &&
1834 if (const auto *I = dyn_cast<IntrinsicInst>(U))
1835 return I->isAssumeLikeIntrinsic();
1842 const User *FUU = FU;
1843 if (isa<BitCastOperator>(FU) && FU->
hasOneUse() &&
1847 if (const auto *GV = dyn_cast<GlobalVariable>(U))
1848 return GV->hasName() &&
1849 (GV->getName().equals(
"llvm.compiler.used") ||
1850 GV->getName().equals(
"llvm.used"));
1859 if (!Call->isCallee(&U) || Call->getFunctionType() !=
getFunctionType()) {
1860 if (IgnoreARCAttachedCall &&
1881 if (!isa<BlockAddress>(U))
1891 if (
const auto *Call = dyn_cast<CallBase>(&
I))
1892 if (Call->hasFnAttr(Attribute::ReturnsTwice))
1900 return cast<Constant>(Op<0>());
1904 setHungoffOperand<0>(Fn);
1905 setValueSubclassDataBit(3, Fn !=
nullptr);
1910 return cast<Constant>(Op<1>());
1914 setHungoffOperand<1>(PrefixData);
1915 setValueSubclassDataBit(1, PrefixData !=
nullptr);
1920 return cast<Constant>(Op<2>());
1924 setHungoffOperand<2>(PrologueData);
1925 setValueSubclassDataBit(2, PrologueData !=
nullptr);
1928 void Function::allocHungoffUselist() {
1944 void Function::setHungoffOperand(
Constant *
C) {
1946 allocHungoffUselist();
1954 void Function::setValueSubclassDataBit(
unsigned Bit,
bool On) {
1955 assert(
Bit < 16 &&
"SubclassData contains only 16 bits");
1964 #if !defined(NDEBUG)
1966 assert(!PrevCount.hasValue() || PrevCount->getType() == Count.
getType());
1970 if (
S ==
nullptr && ImportGUIDs.size())
1975 LLVMContext::MD_prof,
1988 if (MDS->getString().equals(
"function_entry_count")) {
1996 }
else if (AllowSynthetic &&
1997 MDS->getString().equals(
"synthetic_function_entry_count")) {
2009 if (
MDString *MDS = dyn_cast<MDString>(MD->getOperand(0)))
2010 if (MDS->getString().equals(
"function_entry_count"))
2011 for (
unsigned i = 2;
i < MD->getNumOperands();
i++)
2012 R.insert(mdconst::extract<ConstantInt>(MD->getOperand(
i))
2026 assert(cast<MDString>(MD->getOperand(0))
2028 .equals(
"function_section_prefix") &&
2029 "Metadata not match");
2030 return cast<MDString>(MD->getOperand(1))->getString();
2040 if (
F &&
F->nullPointerIsDefined())
Attribute getParamAttribute(unsigned ArgNo, Attribute::AttrKind Kind) const
gets the specified attribute from the list of attributes.
LLVM_NODISCARD AttributeList removeAttributeAtIndex(LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const
Remove the specified attribute at the specified index from this attribute list.
StringRef getBaseName(ID id)
Return the LLVM name for an intrinsic, without encoded types for overloading, such as "llvm....
LLVM_NODISCARD AttributeList removeRetAttribute(LLVMContext &C, Attribute::AttrKind Kind) const
Remove the specified attribute at the return value index from this attribute list.
This class represents an incoming formal argument to a Function.
llvm::Optional< Function * > remangleIntrinsicFunction(Function *F)
bool hasStructRetAttr() const
Return true if this argument has the sret attribute.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
@ FloatTyID
32-bit floating point type
bool isOverloaded(ID id)
Returns true if the intrinsic can be overloaded.
static StringRef getName(Value *V)
static VectorType * getSubdividedVectorType(VectorType *VTy, int NumSubdivs)
bool hasInAllocaAttr() const
Return true if this argument has the inalloca attribute.
@ DoubleTyID
64-bit floating point type
LLVM_NODISCARD AttributeList removeFnAttributes(LLVMContext &C, const AttributeMask &AttrsToRemove) const
Remove the specified attribute at the function index from this attribute list.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_NODISCARD AttributeList addRetAttributes(LLVMContext &C, const AttrBuilder &B) const
Add a return value attribute to the list.
bool hasPassPointeeByValueCopyAttr() const
Return true if this argument has the byval, inalloca, or preallocated attribute.
@ MatchIntrinsicTypes_NoMatchArg
LLVM_NODISCARD AttributeList addDereferenceableParamAttr(LLVMContext &C, unsigned ArgNo, uint64_t Bytes) const
Add the dereferenceable attribute to the attribute set at the given arg index.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
LLVM_NODISCARD AttributeList addFnAttribute(LLVMContext &C, Attribute::AttrKind Kind) const
Add a function attribute to the list.
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
A parsed version of the target data layout string in and methods for querying it.
bool hasOneUse() const
Return true if there is exactly one use of this value.
enum llvm::Intrinsic::IITDescriptor::IITDescriptorKind Kind
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
bool isX86_MMXTy() const
Return true if this is X86 MMX.
void setSectionPrefix(StringRef Prefix)
Set the section prefix for this function.
static Type * getFP128Ty(LLVMContext &C)
Constant * getPrefixData() const
Get the prefix data associated with this function.
static const fltSemantics & IEEEsingle() LLVM_READNONE
void removeAttrs(const AttributeMask &AM)
void removeFnAttrs(const AttributeMask &Attrs)
@ VoidTyID
type with no size
unsigned short getSubclassDataFromValue() const
static Type * DecodeFixedType(ArrayRef< Intrinsic::IITDescriptor > &Infos, ArrayRef< Type * > Tys, LLVMContext &Context)
uint64_t getParamDereferenceableBytes(unsigned ArgNo) const
Extract the number of dereferenceable bytes for a parameter.
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space.
Target - Wrapper for Target specific information.
void eraseFromParent()
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
const APInt & getValue() const
Return the constant as an APInt value reference.
bool hasPointeeInMemoryValueAttr() const
Return true if this argument has the byval, sret, inalloca, preallocated, or byref attribute.
@ None
No unwind table requested.
LLVM_NODISCARD AttributeList addParamAttribute(LLVMContext &C, unsigned ArgNo, Attribute::AttrKind Kind) const
Add an argument attribute to the list.
Type * getParamByValType(unsigned ArgNo) const
Extract the byval type for a parameter.
void dropAllReferences()
Drop all references to operands.
bool hasParamAttribute(unsigned ArgNo, Attribute::AttrKind Kind) const
check if an attributes is in the list of attributes.
static MutableArrayRef< Argument > makeArgArray(Argument *Args, size_t Count)
StringRef getName(ID id)
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
unsigned getAddressSpace() const
Return the address space of the Pointer type.
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
TypeID getTypeID() const
Return the type id for the type.
Type * getParamInAllocaType() const
If this is an inalloca argument, return its type.
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
uint64_t getParamAlignment() const
If this is a byval or inalloca argument, return its alignment.
The instances of the Type class are immutable: once they are created, they are never changed.
void addRetAttr(Attribute::AttrKind Kind)
Add return value attributes to this function.
int lookupLLVMIntrinsicByName(ArrayRef< const char * > NameTable, StringRef Name)
Looks up Name in NameTable via binary search.
static Type * getTokenTy(LLVMContext &C)
unsigned getArgNo() const
Return the index of this formal argument in its containing function.
bool hasInRegAttr() const
Return true if this argument has the inreg attribute.
void addParamAttrs(unsigned ArgNo, const AttrBuilder &Attrs)
adds the attributes to the list of attributes for the given arg.
const Function * getParent() const
AttributeList getAttributes(LLVMContext &C, ID id)
Return the attributes for an intrinsic.
Type * getElementType() const
user_iterator user_begin()
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
bool hasStackProtectorFnAttr() const
Returns true if the function has ssp, sspstrong, or sspreq fn attrs.
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
bool hasRetAttribute(Attribute::AttrKind Kind) const
check if an attribute is in the list of attributes for the return value.
bool isDefTriviallyDead() const
isDefTriviallyDead - Return true if it is trivially safe to remove this function definition from the ...
LinkageTypes
An enumeration for the kinds of linkage for global values.
Class to represent array types.
bool hasSwiftSelfAttr() const
Return true if this argument has the swiftself attribute.
Type * getNonOpaquePointerElementType() const
Only use this method in code that is not reachable with opaque pointers, or part of deprecated method...
bool isMetadataTy() const
Return true if this is 'metadata'.
bool getIntrinsicSignature(Function *F, SmallVectorImpl< Type * > &ArgTys)
Gets the type arguments of an intrinsic call by matching type contraints specified by the ....
bool empty() const
empty - Check if the array is empty.
void addAttributeAtIndex(unsigned i, Attribute Attr)
adds the attribute to the list of attributes.
LLVM Basic Block Representation.
void addFnAttrs(const AttrBuilder &Attrs)
Add function attributes to this function.
@ MatchIntrinsicTypes_NoMatchRet
DenormalMode parseDenormalFPAttribute(StringRef Str)
Returns the denormal mode to use for inputs and outputs.
void setGC(std::string Str)
This is the shared class of boolean and integer constants.
bool isOpaqueOrPointeeTypeMatches(Type *Ty)
Return true if either this is an opaque pointer type or if this pointee type matches Ty.
static Type * getMetadataTy(LLVMContext &C)
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
Return the function type for an intrinsic.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
static VectorType * getTruncatedElementVectorType(VectorType *VTy)
static Type * getX86_AMXTy(LLVMContext &C)
Compile-time customization of User operands.
static Type * getMemoryParamAllocType(AttributeSet ParamAttrs)
For a byval, sret, inalloca, or preallocated parameter, get the in-memory parameter type.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
bool hasZExtAttr() const
Return true if this argument has the zext attribute.
MaybeAlign getParamStackAlign() const
void stealArgumentListFrom(Function &Src)
Steal arguments from another function.
unsigned Struct_NumElements
@ IIT_VEC_OF_BITCASTS_TO_INT
static Type * getPPC_FP128Ty(LLVMContext &C)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static void DecodeIITType(unsigned &NextElt, ArrayRef< unsigned char > Infos, IIT_Info LastInfo, SmallVectorImpl< Intrinsic::IITDescriptor > &OutputTable)
(vector float) vec_cmpeq(*A, *B) C
static Type * getDoubleTy(LLVMContext &C)
bool hasSwiftErrorAttr() const
Return true if this argument has the swifterror attribute.
static VectorType * getInteger(VectorType *VTy)
This static method gets a VectorType with the same number of elements as the input type,...
IIT_Info
IIT_Info - These are enumerators that describe the entries returned by the getIntrinsicInfoTableEntri...
bool hasNoCaptureAttr() const
Return true if this argument has the nocapture attribute.
@ OB_clang_arc_attachedcall
void removeRetAttrs(const AttributeMask &Attrs)
removes the attributes from the return value list of attributes.
iterator_range< use_iterator > uses()
ElementCount getElementCount() const
Return an ElementCount instance to represent the (possibly scalable) number of elements in the vector...
void removeRetAttr(Attribute::AttrKind Kind)
removes the attribute from the return value list of attributes.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
Class to represent integer types.
uint64_t getDereferenceableBytes() const
If this argument has the dereferenceable attribute, return the number of bytes known to be dereferenc...
bool isTokenTy() const
Return true if this is 'token'.
bool hasFnAttr(Attribute::AttrKind Kind) const
Return true if the attribute exists for the function.
const std::string & getGC(const Function &Fn)
Return the GC for a function.
uint64_t getZExtValue() const
Get zero extended value.
void copyAttributesFrom(const Function *Src)
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the ...
void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
removes the attribute from the list of attributes.
void setName(const Twine &Name)
Change the name of the value.
bool hasPersonalityFn() const
Check whether this function has a personality function.
Type * getInAllocaType() const
ArrayRef< Type * > params() const
Attribute getAttribute(Attribute::AttrKind Kind) const
Analysis containing CSE Info
bool hasNestAttr() const
Return true if this argument has the nest attribute.
LLVM_NODISCARD AttributeList removeParamAttribute(LLVMContext &C, unsigned ArgNo, Attribute::AttrKind Kind) const
Remove the specified attribute at the specified arg index from this attribute list.
LLVM_NODISCARD AttributeList removeParamAttributes(LLVMContext &C, unsigned ArgNo, const AttributeMask &AttrsToRemove) const
Remove the specified attribute at the specified arg index from this attribute list.
LLVM_NODISCARD AttributeList addDereferenceableOrNullParamAttr(LLVMContext &C, unsigned ArgNo, uint64_t Bytes) const
Add the dereferenceable_or_null attribute to the attribute set at the given arg index.
static PointerType * getInt1PtrTy(LLVMContext &C, unsigned AS=0)
Optional< StringRef > getSectionPrefix() const
Get the section prefix for this function.
static std::string getMangledTypeStr(Type *Ty, bool &HasUnnamedType)
Returns a stable mangling for the type specified for use in the name mangling scheme used by 'any' ty...
@ BFloatTyID
16-bit floating point type (7-bit significand)
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
StringRef getValueAsString() const
Return the attribute's value as a string.
Intrinsic::ID IntID
The intrinsic ID for this subclass (which must be a Function).
Type * getParamInAllocaType(unsigned ArgNo) const
Extract the inalloca type for a parameter.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
LLVM_NODISCARD AttributeList removeRetAttributes(LLVMContext &C, const AttributeMask &AttrsToRemove) const
Remove the specified attribute at the return value index from this attribute list.
bool hasByRefAttr() const
Return true if this argument has the byref attribute.
bool hasPrologueData() const
Check whether this function has prologue data.
LLVM_NODISCARD AttributeList addFnAttributes(LLVMContext &C, const AttrBuilder &B) const
Add function attribute to the list.
AttributeList getAttributes() const
Return the attribute list for this Function.
uint64_t getDereferenceableOrNullBytes() const
If this argument has the dereferenceable_or_null attribute, return the number of bytes known to be de...
Type * getParamStructRetType() const
If this is an sret argument, return its type.
const std::string & getGC() const
bool isIntegerTy() const
True if this is an instance of IntegerType.
const MDOperand & getOperand(unsigned I) const
@ MatchIntrinsicTypes_Match
bool hasAttribute(Attribute::AttrKind Kind) const
Check if an argument has a given attribute.
Base class of all SIMD vector types.
static std::string getIntrinsicNameImpl(Intrinsic::ID Id, ArrayRef< Type * > Tys, Module *M, FunctionType *FT, bool EarlyModuleCheck)
Implements a dense probed hash-table based set.
static IITDescriptor get(IITDescriptorKind K, unsigned Field)
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
bool hasAvailableExternallyLinkage() const
Function::ProfileCount ProfileCount
Optional< ProfileCount > getEntryCount(bool AllowSynthetic=false) const
Get the entry count for this function.
inst_range instructions(Function *F)
Attribute getAttributeAtIndex(unsigned i, Attribute::AttrKind Kind) const
gets the attribute from the list of attributes.
This is an important base class in LLVM.
static PointerType * getUnqual(Type *ElementType)
This constructs a pointer to an object of the specified type in the default address space (address sp...
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
bool matchIntrinsicVarArg(bool isVarArg, ArrayRef< IITDescriptor > &Infos)
Verify if the intrinsic has variable arguments.
bool hasPrefixData() const
Check whether this function has prefix data.
void dropAllReferences()
dropAllReferences() - This method causes all the subinstructions to "let go" of all references that t...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void allocHungoffUses(unsigned N, bool IsPhi=false)
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User.
Module * getParent()
Get the module that this global value is contained inside of...
@ X86_MMXTyID
MMX vectors (64 bits, X86 specific)
LLVM_NODISCARD AttributeList addParamAttributes(LLVMContext &C, unsigned ArgNo, const AttrBuilder &B) const
Add an argument attribute to the list.
bool hasGC() const
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generatio...
static ConstantPointerNull * get(PointerType *T)
Static factory methods - Return objects of the specified value.
void getIntrinsicInfoTableEntries(ID id, SmallVectorImpl< IITDescriptor > &T)
Return the IIT table descriptor for the specified intrinsic into an array of IITDescriptors.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
This is an important class for using LLVM in a threaded context.
Function::ProfileCount ProfileCount
void addDereferenceableOrNullParamAttr(unsigned ArgNo, uint64_t Bytes)
adds the dereferenceable_or_null attribute to the list of attributes for the given arg.
Represent subnormal handling kind for floating point instruction inputs and outputs.
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results,...
initializer< Ty > init(const Ty &Val)
void setGC(const Function &Fn, std::string GCName)
Define the GC for a function.
bool hasNoFreeAttr() const
Return true if this argument has the nofree attribute.
Class to represent pointers.
bool hasPreallocatedAttr() const
Return true if this argument has the preallocated attribute.
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
bool isLeaf(ID id)
Returns true if the intrinsic is a leaf, i.e.
void removeAttr(Attribute::AttrKind Kind)
Remove attributes from an argument.
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool hasLocalLinkage() const
static Intrinsic::ID lookupIntrinsicID(StringRef Name)
This does the actual lookup of an intrinsic ID which matches the given function name.
Argument(Type *Ty, const Twine &Name="", Function *F=nullptr, unsigned ArgNo=0)
Argument constructor.
static cl::opt< unsigned > NonGlobalValueMaxNameSize("non-global-value-max-name-size", cl::Hidden, cl::init(1024), cl::desc("Maximum size for the name of non-global values."))
bool isVoidTy() const
Return true if this is 'void'.
void setPersonalityFn(Constant *Fn)
std::pair< Type *, ArrayRef< Intrinsic::IITDescriptor > > DeferredIntrinsicMatchPair
A Module instance is used to store all the information related to an LLVM module.
void clearMetadata()
Erase all metadata attached to this Value.
bool isCallbackCall() const
Return true if this ACS represents a callback call.
@ FP128TyID
128-bit floating point type (112-bit significand)
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
static Function * createWithDefaultAttr(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
Creates a function with some attributes recorded in llvm.module.flags applied.
void setEntryCount(ProfileCount Count, const DenseSet< GlobalValue::GUID > *Imports=nullptr)
Set the entry count for this function.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Class to represent struct types.
@ PPC_FP128TyID
128-bit floating point type (two 64-bits, PowerPC)
StringRef - Represent a constant reference to a string, i.e.
Analysis the ScalarEvolution expression for r is this
void setCallingConv(CallingConv::ID CC)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Type * getType() const
All values are typed, get the type of this value.
Type * getParamByRefType() const
If this is a byref argument, return its type.
MaybeAlign getParamAlign(unsigned ArgNo) const
self_iterator getIterator()
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MDNode * getMetadata(unsigned KindID) const
Get the current metadata attachments for the given kind, if any.
uint64_t getPassPointeeByValueCopySize(const DataLayout &DL) const
If this argument satisfies has hasPassPointeeByValueAttr, return the in-memory ABI size copied to the...
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
ProfileCountType getType() const
const FunctionListType & getFunctionList() const
Get the Module's list of functions (constant).
static VectorType * getHalfElementsVectorType(VectorType *VTy)
This static method returns a VectorType with half as many elements as the input type and the same ele...
Linkage
Describes symbol linkage.
bool hasAddressTaken(const User **=nullptr, bool IgnoreCallbackUses=false, bool IgnoreAssumeLikeCalls=true, bool IngoreLLVMUsed=false, bool IgnoreARCAttachedCall=false) const
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invo...
bool callsFunctionThatReturnsTwice() const
callsFunctionThatReturnsTwice - Return true if the function has a call to setjmp or other function th...
void setMetadata(unsigned KindID, MDNode *Node)
Set a particular kind of metadata attachment.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
StringRef getName() const
Return a constant reference to the value's name.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
Helper struct shared between Function Specialization and SCCP Solver.
static ArrayRef< const char * > findTargetSubtable(StringRef Name)
Find the segment of IntrinsicNameTable for intrinsics with the same target as Name,...
void setIsMaterializable(bool V)
const T & front() const
front - Get the first element.
DenormalMode getDenormalMode(const fltSemantics &FPType) const
Returns the denormal handling type for the default rounding mode of the function.
uint64_t getCount() const
MDNode * createFunctionSectionPrefix(StringRef Prefix)
Return metadata containing the section prefix for a function.
@ IntegerTyID
Arbitrary bit width integers.
void addAttrs(AttrBuilder &B)
Add attributes to an argument.
static VectorType * getExtendedElementVectorType(VectorType *VTy)
This static method is like getInteger except that the element types are twice as wide as the elements...
bool hasLazyArguments() const
hasLazyArguments/CheckLazyArguments - The argument list of a function is built on demand,...
auto partition_point(R &&Range, Predicate P)
Binary search for the first iterator in a range where a predicate is false.
uint64_t getParamAlignment(unsigned ArgNo) const
Extract the alignment for a call or parameter (0=unknown).
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
adds the attribute to the list of attributes for the given arg.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
@ IIT_VEC_OF_ANYPTRS_TO_ELT
Type * getPreallocatedType() const
void removeAttributeAtIndex(unsigned i, Attribute::AttrKind Kind)
removes the attribute from the list of attributes.
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
Type * getByRefType() const
static Type * getHalfTy(LLVMContext &C)
Type * getByValType() const
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
uint64_t getParamDereferenceableOrNullBytes(unsigned ArgNo) const
Extract the number of dereferenceable_or_null bytes for a parameter.
bool hasNonNullAttr(bool AllowUndefOrPoison=true) const
Return true if this argument has the nonnull attribute.
bool hasByValAttr() const
Return true if this argument has the byval attribute.
Type * getParamByValType() const
If this is a byval argument, return its type.
void addDereferenceableParamAttr(unsigned ArgNo, uint64_t Bytes)
adds the dereferenceable attribute to the list of attributes for the given arg.
static const char *const IntrinsicNameTable[]
Table of string intrinsic names indexed by enum value.
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
bool isTargetIntrinsic() const
isTargetIntrinsic - Returns true if this function is an intrinsic and the intrinsic is specific to a ...
bool isPPC_FP128Ty() const
Return true if this is powerpc long double.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
LLVM_NODISCARD AttributeList addRetAttribute(LLVMContext &C, Attribute::AttrKind Kind) const
Add a return value attribute to the list.
Attribute getAttributeAtIndex(unsigned Index, Attribute::AttrKind Kind) const
Return the attribute object that exists at the given index.
void addRetAttrs(const AttrBuilder &Attrs)
Add return value attributes to this function.
bool isConstrainedFPIntrinsic() const
Returns true if the function is one of the "Constrained Floating-Point Intrinsics".
static Type * getBFloatTy(LLVMContext &C)
MaybeAlign getParamStackAlign(unsigned ArgNo) const
Constant * getPersonalityFn() const
Get the personality function associated with this function.
unsigned getInstructionCount() const
Returns the number of non-debug IR instructions in this function.
std::string getNameNoUnnamedTypes(ID Id, ArrayRef< Type * > Tys)
Return the LLVM name for an intrinsic.
static unsigned computeAddrSpace(unsigned AddrSpace, Module *M)
void deleteGC(const Function &Fn)
Remove the GC for a function.
Type * getParamByRefType(unsigned ArgNo) const
Extract the byref type for a parameter.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
void removeParamAttrs(unsigned ArgNo, const AttributeMask &Attrs)
removes the attribute from the list of attributes.
unsigned HasLLVMReservedName
True if the function's name starts with "llvm.".
static Type * getVoidTy(LLVMContext &C)
bool nullPointerIsDefined() const
Check if null pointer dereferencing is considered undefined behavior for the function.
unsigned getNumOperands() const
Type * getPointeeInMemoryValueType() const
If hasPointeeInMemoryValueAttr returns true, the in-memory ABI type is returned.
static bool matchIntrinsicType(Type *Ty, ArrayRef< Intrinsic::IITDescriptor > &Infos, SmallVectorImpl< Type * > &ArgTys, SmallVectorImpl< DeferredIntrinsicMatchPair > &DeferredChecks, bool IsDeferredCheck)
void setPrefixData(Constant *PrefixData)
bool isBFloatTy() const
Return true if this is 'bfloat', a 16-bit bfloat type.
bool hasRetAttr(Attribute::AttrKind Kind) const
Return true if the attribute exists for the return value.
void removeFnAttr(Attribute::AttrKind Kind)
Remove function attributes from this function.
LLVM_NODISCARD AttributeList removeFnAttribute(LLVMContext &C, Attribute::AttrKind Kind) const
Remove the specified attribute at the function index from this attribute list.
bool hasNoAliasAttr() const
Return true if this argument has the noalias attribute.
size_t size() const
size - Get the array size.
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
MatchIntrinsicTypesResult matchIntrinsicSignature(FunctionType *FTy, ArrayRef< IITDescriptor > &Infos, SmallVectorImpl< Type * > &ArgTys)
Match the specified function type with the type constraints specified by the .td file.
void addFnAttr(Attribute::AttrKind Kind)
Add function attributes to this function.
void copyAttributesFrom(const GlobalObject *Src)
static IITDescriptor getVector(unsigned Width, bool IsScalable)
MaybeAlign getParamAlign() const
If this is a byval or inalloca argument, return its alignment.
bool hasLinkOnceLinkage() const
void removeFromParent()
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it.
LLVM_NODISCARD AttributeList addAttributeAtIndex(LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const
Add an attribute to the attribute set at the given index.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Type * getStructRetType() const
PointerType * getType() const
Global values are always pointers.
void setPrologueData(Constant *PrologueData)
void recalculateIntrinsicID()
Recalculate the ID for this function if it is an Intrinsic defined in llvm/Intrinsics....
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
Constant * getPrologueData() const
Get the prologue data associated with this function.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Class to represent profile counts.
This is a type descriptor which explains the type requirements of an intrinsic.
bool NullPointerIsDefined(const Function *F, unsigned AS=0)
Check whether null pointer dereferencing is considered undefined behavior for a given function or an ...
static Type * getX86_MMXTy(LLVMContext &C)
bool hasParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const
Return true if the attribute exists for the given argument.
MatchIntrinsicTypesResult
AttributeSet getParamAttrs(unsigned ArgNo) const
The attributes for the argument or parameter at the given index are returned.
bool onlyReadsMemory() const
Return true if this argument has the readonly or readnone attribute.
MDNode * createFunctionEntryCount(uint64_t Count, bool Synthetic, const DenseSet< GlobalValue::GUID > *Imports)
Return metadata containing the entry Count for a function, a boolean \Synthetic indicating whether th...
Attribute getFnAttr(Attribute::AttrKind Kind) const
Return the attribute object that exists for the function.
Type * getParamStructRetType(unsigned ArgNo) const
Extract the sret type for a parameter.
void setAttributes(AttributeList Attrs)
Set the attribute list for this Function.
bool hasSExtAttr() const
Return true if this argument has the sext attribute.
Type * getReturnType() const
LLVM Value Representation.
bool isFP128Ty() const
Return true if this is 'fp128'.
void setNumHungOffUseOperands(unsigned NumOps)
Subclasses with hung off uses need to manage the operand count themselves.
static VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
@ HalfTyID
16-bit floating point type
iterator_range< user_iterator > users()
@ X86_FP80TyID
80-bit floating point type (X87)
Attribute getParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const
Return the attribute object that exists at the arg index.
static Type * getFloatTy(LLVMContext &C)
ArgKind getArgumentKind() const
bool isX86_AMXTy() const
Return true if this is X86 AMX.
bool hasReturnedAttr() const
Return true if this argument has the returned attribute.
Class to represent function types.
void addAttr(Attribute::AttrKind Kind)
A Use represents the edge between a Value definition and its users.
reference emplace_back(ArgTypes &&... Args)
DenseSet< GlobalValue::GUID > getImportGUIDs() const
Returns the set of GUIDs that needs to be imported to the function for sample PGO,...