Go to the documentation of this file.
31 assert(Accuracy > 0.0 &&
"Invalid fpmath accuracy!");
43 assert(Weights.
size() >= 1 &&
"Need at least one branch weights!");
49 for (
unsigned i = 0,
e = Weights.
size();
i !=
e; ++
i)
65 Ops.push_back(
createString(
"synthetic_function_entry_count"));
72 for (
auto ID : OrderID)
85 assert(Lo.getBitWidth() == Hi.getBitWidth() &&
"Mismatched bitwidths!");
109 bool VarArgArePassed) {
126 if (!ExistingCallbacks)
129 auto *NewCBCalleeIdxAsCM = cast<ConstantAsMetadata>(NewCB->
getOperand(0));
131 cast<ConstantInt>(NewCBCalleeIdxAsCM->getValue())->getZExtValue();
132 (void)NewCBCalleeIdx;
136 Ops.
resize(NumExistingOps + 1);
138 for (
unsigned u = 0; u < NumExistingOps; u++) {
141 auto *OldCBCalleeIdxAsCM = cast<ConstantAsMetadata>(Ops[u]);
143 cast<ConstantInt>(OldCBCalleeIdxAsCM->getValue())->getZExtValue();
144 (void)OldCBCalleeIdx;
145 assert(NewCBCalleeIdx != OldCBCalleeIdx &&
146 "Cannot map a callback callee index twice!");
149 Ops[NumExistingOps] = NewCB;
164 for (
const auto &Entry : Sections) {
170 if (!AuxConsts.empty()) {
172 AuxMDs.
reserve(AuxConsts.size());
185 Args.push_back(Extra);
229 for (
unsigned i = 0,
e = Fields.
size();
i !=
e; ++
i) {
232 Vals[
i * 3 + 2] = Fields[
i].Type;
244 for (
unsigned i = 0,
e = Fields.size();
i !=
e; ++
i) {
245 Ops[
i * 2 + 1] = Fields[
i].first;
281 for (
unsigned I = 0,
E = Fields.
size();
I !=
E; ++
I) {
282 Ops[
I * 3 + 3] = Fields[
I].Type;
298 ImmutabilityFlagNode});
305 MDNode *AccessType = cast<MDNode>(
Tag->getOperand(1));
307 uint64_t Offset = mdconst::extract<ConstantInt>(OffsetNode)->getZExtValue();
309 bool NewFormat = isa<MDNode>(AccessType->
getOperand(0));
312 unsigned ImmutabilityFlagOp = NewFormat ? 4 : 3;
313 if (
Tag->getNumOperands() <= ImmutabilityFlagOp)
317 Metadata *ImmutabilityFlagNode =
Tag->getOperand(ImmutabilityFlagOp);
318 if (!mdconst::extract<ConstantInt>(ImmutabilityFlagNode)->getValue())
326 uint64_t Size = mdconst::extract<ConstantInt>(SizeNode)->getZExtValue();
352 for (
size_t I = 0;
I < LLVMStats.size();
I++) {
This is an optimization pass for GlobalISel generic memory operations.
ConstantAsMetadata * createConstant(Constant *C)
Return the given constant as metadata.
MDNode * createMutableTBAAAccessTag(MDNode *Tag)
Return mutable version of the given mutable or immutable TBAA access tag.
static IntegerType * getInt1Ty(LLVMContext &C)
MDNode * createTBAAStructTypeNode(StringRef Name, ArrayRef< std::pair< MDNode *, uint64_t >> Fields)
Return metadata for a TBAA struct node in the type DAG with the given name, a list of pairs (offset,...
MDNode * createFPMath(float Accuracy)
Return metadata with the given settings.
MDNode * createAliasScopeDomain(StringRef Name)
Return metadata appropriate for an alias scope domain node with the given name.
MDNode * createPseudoProbeDesc(uint64_t GUID, uint64_t Hash, Function *F)
Return metadata containing the pseudo probe descriptor for a function.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
MDNode * createAliasScope(StringRef Name, MDNode *Domain)
Return metadata appropriate for an alias scope node with the given name.
MDNode * createUnpredictable()
Return metadata specifying that a branch or switch is unpredictable.
The instances of the Type class are immutable: once they are created, they are never changed.
static IntegerType * getInt32Ty(LLVMContext &C)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
unsigned getNumOperands() const
Return number of MDNode operands.
This is the shared class of boolean and integer constants.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
(vector float) vec_cmpeq(*A, *B) C
MDNode * createBranchWeights(uint32_t TrueWeight, uint32_t FalseWeight)
Return metadata containing two branch weights.
MDNode * createTBAANode(StringRef Name, MDNode *Parent, bool isConstant=false)
Return metadata for a non-root TBAA node with the given name, parent in the TBAA tree,...
Class to represent integer types.
static Constant * get(Type *Ty, uint64_t V, bool IsSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
MDNode * createTBAAStructTagNode(MDNode *BaseType, MDNode *AccessType, uint64_t Offset, bool IsConstant=false)
Return metadata for a TBAA tag node with the given base type, access type and offset relative to the ...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
MDNode * mergeCallbackEncodings(MDNode *ExistingCallbacks, MDNode *NewCB)
Merge the new callback encoding NewCB into ExistingCallbacks.
void sort(IteratorTy Start, IteratorTy End)
const MDOperand & getOperand(unsigned I) const
MDString * createString(StringRef Str)
Return the given string as metadata.
Implements a dense probed hash-table based set.
MDNode * createPCSections(ArrayRef< PCSection > Sections)
Return metadata for PC sections.
BaseType
A given derived pointer can have multiple base pointers through phi/selects.
This is an important base class in LLVM.
MDNode * createLLVMStats(ArrayRef< std::pair< StringRef, uint64_t >> LLVMStatsVec)
Return metadata containing llvm statistics.
static bool isConstant(const MachineInstr &MI)
static MDString * get(LLVMContext &Context, StringRef Str)
MDNode * createTBAAAccessTag(MDNode *BaseType, MDNode *AccessType, uint64_t Offset, uint64_t Size, bool IsImmutable=false)
Return metadata for a TBAA access tag with the given base type, final access type,...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MDNode * createCallbackEncoding(unsigned CalleeArgNo, ArrayRef< int > Arguments, bool VarArgsArePassed)
Return metadata describing a callback (see llvm::AbstractCallSite).
Class for arbitrary precision integers.
StringRef - Represent a constant reference to a string, i.e.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
MDNode * createFunctionSectionPrefix(StringRef Prefix)
Return metadata containing the section prefix for a function.
MDNode * createAnonymousAARoot(StringRef Name=StringRef(), MDNode *Extra=nullptr)
Return metadata appropriate for a AA root node (scope or TBAA).
MDNode * createTBAAStructNode(ArrayRef< TBAAStructField > Fields)
Return metadata for a tbaa.struct node with the given struct field descriptions.
static IntegerType * getInt64Ty(LLVMContext &C)
static Constant * get(Type *Ty, double V)
This returns a ConstantFP, or a vector containing a splat of a ConstantFP, for the specified value in...
AMDGPU Lower Kernel Arguments
MDNode * createTBAAScalarTypeNode(StringRef Name, MDNode *Parent, uint64_t Offset=0)
Return metadata for a TBAA scalar type node with the given name, an offset and a parent in the TBAA t...
void replaceOperandWith(unsigned I, Metadata *New)
Replace a specific operand.
MDNode * createTBAARoot(StringRef Name)
Return metadata appropriate for a TBAA root node with the given name.
MDNode * createCallees(ArrayRef< Function * > Callees)
Return metadata indicating the possible callees of indirect calls.
MDNode * createRange(const APInt &Lo, const APInt &Hi)
Return metadata describing the range [Lo, Hi).
size_t size() const
size - Get the array size.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
MDNode * createTBAATypeNode(MDNode *Parent, uint64_t Size, Metadata *Id, ArrayRef< TBAAStructField > Fields=ArrayRef< TBAAStructField >())
Return metadata for a TBAA type node in the TBAA type DAG with the given parent type,...
MDNode * createRTTIPointerPrologue(Constant *PrologueSig, Constant *RTTI)
Return metadata feeding to the CodeGen about how to generate a function prologue for the "function" s...
void reserve(size_type N)
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...
static Type * getFloatTy(LLVMContext &C)
MDNode * createIrrLoopHeaderWeight(uint64_t Weight)
Return metadata containing an irreducible loop header weight.