Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
MDBuilder.cpp
Go to the documentation of this file.
1//===---- llvm/MDBuilder.cpp - Builder for LLVM metadata ------------------===//
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//
9// This file defines the MDBuilder class, which is used as a convenient way to
10// create LLVM metadata with a consistent and simplified interface.
11//
12//===----------------------------------------------------------------------===//
13
14#include "llvm/IR/MDBuilder.h"
15#include "llvm/IR/Constants.h"
16#include "llvm/IR/Function.h"
17#include "llvm/IR/Metadata.h"
18using namespacellvm;
19
20MDString *MDBuilder::createString(StringRef Str) {
21returnMDString::get(Context, Str);
22}
23
24ConstantAsMetadata *MDBuilder::createConstant(Constant *C) {
25returnConstantAsMetadata::get(C);
26}
27
28MDNode *MDBuilder::createFPMath(float Accuracy) {
29if (Accuracy == 0.0)
30returnnullptr;
31assert(Accuracy > 0.0 &&"Invalid fpmath accuracy!");
32auto *Op =
33createConstant(ConstantFP::get(Type::getFloatTy(Context), Accuracy));
34returnMDNode::get(Context,Op);
35}
36
37MDNode *MDBuilder::createBranchWeights(uint32_t TrueWeight,
38uint32_t FalseWeight,bool IsExpected) {
39returncreateBranchWeights({TrueWeight, FalseWeight}, IsExpected);
40}
41
42MDNode *MDBuilder::createLikelyBranchWeights() {
43// Value chosen to match UR_NONTAKEN_WEIGHT, see BranchProbabilityInfo.cpp
44returncreateBranchWeights((1U << 20) - 1, 1);
45}
46
47MDNode *MDBuilder::createUnlikelyBranchWeights() {
48// Value chosen to match UR_NONTAKEN_WEIGHT, see BranchProbabilityInfo.cpp
49returncreateBranchWeights(1, (1U << 20) - 1);
50}
51
52MDNode *MDBuilder::createBranchWeights(ArrayRef<uint32_t> Weights,
53bool IsExpected) {
54assert(Weights.size() >= 1 &&"Need at least one branch weights!");
55
56unsignedintOffset = IsExpected ? 2 : 1;
57SmallVector<Metadata *, 4> Vals(Weights.size() +Offset);
58 Vals[0] =createString("branch_weights");
59if (IsExpected)
60 Vals[1] =createString("expected");
61
62Type *Int32Ty =Type::getInt32Ty(Context);
63for (unsigned i = 0, e = Weights.size(); i != e; ++i)
64 Vals[i +Offset] =createConstant(ConstantInt::get(Int32Ty, Weights[i]));
65
66returnMDNode::get(Context, Vals);
67}
68
69MDNode *MDBuilder::createUnpredictable() {returnMDNode::get(Context, {}); }
70
71MDNode *MDBuilder::createFunctionEntryCount(
72uint64_t Count,bool Synthetic,
73constDenseSet<GlobalValue::GUID> *Imports) {
74Type *Int64Ty =Type::getInt64Ty(Context);
75SmallVector<Metadata *, 8> Ops;
76if (Synthetic)
77 Ops.push_back(createString("synthetic_function_entry_count"));
78else
79 Ops.push_back(createString("function_entry_count"));
80 Ops.push_back(createConstant(ConstantInt::get(Int64Ty, Count)));
81if (Imports) {
82SmallVector<GlobalValue::GUID, 2> OrderID(Imports->begin(), Imports->end());
83llvm::sort(OrderID);
84for (autoID : OrderID)
85 Ops.push_back(createConstant(ConstantInt::get(Int64Ty,ID)));
86 }
87returnMDNode::get(Context, Ops);
88}
89
90MDNode *MDBuilder::createFunctionSectionPrefix(StringRef Prefix) {
91returnMDNode::get(
92 Context, {createString("function_section_prefix"),createString(Prefix)});
93}
94
95MDNode *MDBuilder::createRange(constAPInt &Lo,constAPInt &Hi) {
96assert(Lo.getBitWidth() ==Hi.getBitWidth() &&"Mismatched bitwidths!");
97
98Type *Ty =IntegerType::get(Context,Lo.getBitWidth());
99returncreateRange(ConstantInt::get(Ty,Lo), ConstantInt::get(Ty,Hi));
100}
101
102MDNode *MDBuilder::createRange(Constant *Lo,Constant *Hi) {
103// If the range is everything then it is useless.
104if (Hi ==Lo)
105returnnullptr;
106
107// Return the range [Lo, Hi).
108returnMDNode::get(Context, {createConstant(Lo),createConstant(Hi)});
109}
110
111MDNode *MDBuilder::createCallees(ArrayRef<Function *> Callees) {
112SmallVector<Metadata *, 4> Ops;
113for (Function *F : Callees)
114 Ops.push_back(createConstant(F));
115returnMDNode::get(Context, Ops);
116}
117
118MDNode *MDBuilder::createCallbackEncoding(unsigned CalleeArgNo,
119ArrayRef<int>Arguments,
120bool VarArgArePassed) {
121SmallVector<Metadata *, 4> Ops;
122
123Type *Int64 =Type::getInt64Ty(Context);
124 Ops.push_back(createConstant(ConstantInt::get(Int64, CalleeArgNo)));
125
126for (int ArgNo :Arguments)
127 Ops.push_back(createConstant(ConstantInt::get(Int64, ArgNo,true)));
128
129Type *Int1 =Type::getInt1Ty(Context);
130 Ops.push_back(createConstant(ConstantInt::get(Int1, VarArgArePassed)));
131
132returnMDNode::get(Context, Ops);
133}
134
135MDNode *MDBuilder::mergeCallbackEncodings(MDNode *ExistingCallbacks,
136MDNode *NewCB) {
137if (!ExistingCallbacks)
138returnMDNode::get(Context, {NewCB});
139
140auto *NewCBCalleeIdxAsCM = cast<ConstantAsMetadata>(NewCB->getOperand(0));
141uint64_t NewCBCalleeIdx =
142 cast<ConstantInt>(NewCBCalleeIdxAsCM->getValue())->getZExtValue();
143 (void)NewCBCalleeIdx;
144
145SmallVector<Metadata *, 4> Ops;
146unsigned NumExistingOps = ExistingCallbacks->getNumOperands();
147 Ops.resize(NumExistingOps + 1);
148
149for (unsigned u = 0; u < NumExistingOps; u++) {
150 Ops[u] = ExistingCallbacks->getOperand(u);
151
152auto *OldCBCalleeIdxAsCM =
153 cast<ConstantAsMetadata>(cast<MDNode>(Ops[u])->getOperand(0));
154uint64_t OldCBCalleeIdx =
155 cast<ConstantInt>(OldCBCalleeIdxAsCM->getValue())->getZExtValue();
156 (void)OldCBCalleeIdx;
157assert(NewCBCalleeIdx != OldCBCalleeIdx &&
158"Cannot map a callback callee index twice!");
159 }
160
161 Ops[NumExistingOps] = NewCB;
162returnMDNode::get(Context, Ops);
163}
164
165MDNode *MDBuilder::createRTTIPointerPrologue(Constant *PrologueSig,
166Constant *RTTI) {
167SmallVector<Metadata *, 4> Ops;
168 Ops.push_back(createConstant(PrologueSig));
169 Ops.push_back(createConstant(RTTI));
170returnMDNode::get(Context, Ops);
171}
172
173MDNode *MDBuilder::createPCSections(ArrayRef<PCSection> Sections) {
174SmallVector<Metadata *, 2> Ops;
175
176for (constauto &Entry : Sections) {
177constStringRef &Sec = Entry.first;
178 Ops.push_back(createString(Sec));
179
180// If auxiliary data for this section exists, append it.
181constSmallVector<Constant *> &AuxConsts = Entry.second;
182if (!AuxConsts.empty()) {
183SmallVector<Metadata *, 1> AuxMDs;
184 AuxMDs.reserve(AuxConsts.size());
185for (Constant *C : AuxConsts)
186 AuxMDs.push_back(createConstant(C));
187 Ops.push_back(MDNode::get(Context, AuxMDs));
188 }
189 }
190
191returnMDNode::get(Context, Ops);
192}
193
194MDNode *MDBuilder::createAnonymousAARoot(StringRefName,MDNode *Extra) {
195SmallVector<Metadata *, 3> Args(1,nullptr);
196if (Extra)
197 Args.push_back(Extra);
198if (!Name.empty())
199 Args.push_back(createString(Name));
200MDNode *Root =MDNode::getDistinct(Context, Args);
201
202// At this point we have
203// !0 = distinct !{null} <- root
204// Replace the reserved operand with the root node itself.
205 Root->replaceOperandWith(0, Root);
206
207// We now have
208// !0 = distinct !{!0} <- root
209return Root;
210}
211
212MDNode *MDBuilder::createTBAARoot(StringRefName) {
213returnMDNode::get(Context,createString(Name));
214}
215
216/// Return metadata for a non-root TBAA node with the given name,
217/// parent in the TBAA tree, and value for 'pointsToConstantMemory'.
218MDNode *MDBuilder::createTBAANode(StringRefName,MDNode *Parent,
219boolisConstant) {
220if (isConstant) {
221Constant *Flags = ConstantInt::get(Type::getInt64Ty(Context), 1);
222returnMDNode::get(Context,
223 {createString(Name), Parent,createConstant(Flags)});
224 }
225returnMDNode::get(Context, {createString(Name), Parent});
226}
227
228MDNode *MDBuilder::createAliasScopeDomain(StringRefName) {
229returnMDNode::get(Context,createString(Name));
230}
231
232MDNode *MDBuilder::createAliasScope(StringRefName,MDNode *Domain) {
233returnMDNode::get(Context, {createString(Name),Domain});
234}
235
236/// Return metadata for a tbaa.struct node with the given
237/// struct field descriptions.
238MDNode *MDBuilder::createTBAAStructNode(ArrayRef<TBAAStructField> Fields) {
239SmallVector<Metadata *, 4> Vals(Fields.size() * 3);
240Type *Int64 =Type::getInt64Ty(Context);
241for (unsigned i = 0, e = Fields.size(); i != e; ++i) {
242 Vals[i * 3 + 0] =createConstant(ConstantInt::get(Int64, Fields[i].Offset));
243 Vals[i * 3 + 1] =createConstant(ConstantInt::get(Int64, Fields[i].Size));
244 Vals[i * 3 + 2] = Fields[i].Type;
245 }
246returnMDNode::get(Context, Vals);
247}
248
249/// Return metadata for a TBAA struct node in the type DAG
250/// with the given name, a list of pairs (offset, field type in the type DAG).
251MDNode *MDBuilder::createTBAAStructTypeNode(
252StringRefName,ArrayRef<std::pair<MDNode *, uint64_t>> Fields) {
253SmallVector<Metadata *, 4> Ops(Fields.size() * 2 + 1);
254Type *Int64 =Type::getInt64Ty(Context);
255 Ops[0] =createString(Name);
256for (unsigned i = 0, e = Fields.size(); i != e; ++i) {
257 Ops[i * 2 + 1] = Fields[i].first;
258 Ops[i * 2 + 2] =createConstant(ConstantInt::get(Int64, Fields[i].second));
259 }
260returnMDNode::get(Context, Ops);
261}
262
263/// Return metadata for a TBAA scalar type node with the
264/// given name, an offset and a parent in the TBAA type DAG.
265MDNode *MDBuilder::createTBAAScalarTypeNode(StringRefName,MDNode *Parent,
266uint64_tOffset) {
267ConstantInt *Off = ConstantInt::get(Type::getInt64Ty(Context),Offset);
268returnMDNode::get(Context,
269 {createString(Name), Parent,createConstant(Off)});
270}
271
272/// Return metadata for a TBAA tag node with the given
273/// base type, access type and offset relative to the base type.
274MDNode *MDBuilder::createTBAAStructTagNode(MDNode *BaseType,MDNode *AccessType,
275uint64_tOffset,bool IsConstant) {
276IntegerType *Int64 =Type::getInt64Ty(Context);
277ConstantInt *Off = ConstantInt::get(Int64,Offset);
278if (IsConstant) {
279returnMDNode::get(Context, {BaseType, AccessType,createConstant(Off),
280createConstant(ConstantInt::get(Int64, 1))});
281 }
282returnMDNode::get(Context, {BaseType, AccessType,createConstant(Off)});
283}
284
285MDNode *MDBuilder::createTBAATypeNode(MDNode *Parent,uint64_tSize,
286Metadata *Id,
287ArrayRef<TBAAStructField> Fields) {
288SmallVector<Metadata *, 4> Ops(3 + Fields.size() * 3);
289Type *Int64 =Type::getInt64Ty(Context);
290 Ops[0] = Parent;
291 Ops[1] =createConstant(ConstantInt::get(Int64,Size));
292 Ops[2] = Id;
293for (unsignedI = 0, E = Fields.size();I != E; ++I) {
294 Ops[I * 3 + 3] = Fields[I].Type;
295 Ops[I * 3 + 4] =createConstant(ConstantInt::get(Int64, Fields[I].Offset));
296 Ops[I * 3 + 5] =createConstant(ConstantInt::get(Int64, Fields[I].Size));
297 }
298returnMDNode::get(Context, Ops);
299}
300
301MDNode *MDBuilder::createTBAAAccessTag(MDNode *BaseType,MDNode *AccessType,
302uint64_tOffset,uint64_tSize,
303bool IsImmutable) {
304IntegerType *Int64 =Type::getInt64Ty(Context);
305auto *OffsetNode =createConstant(ConstantInt::get(Int64,Offset));
306auto *SizeNode =createConstant(ConstantInt::get(Int64,Size));
307if (IsImmutable) {
308auto *ImmutabilityFlagNode =createConstant(ConstantInt::get(Int64, 1));
309returnMDNode::get(Context, {BaseType, AccessType, OffsetNode, SizeNode,
310 ImmutabilityFlagNode});
311 }
312returnMDNode::get(Context, {BaseType, AccessType, OffsetNode, SizeNode});
313}
314
315MDNode *MDBuilder::createMutableTBAAAccessTag(MDNode *Tag) {
316MDNode *BaseType = cast<MDNode>(Tag->getOperand(0));
317MDNode *AccessType = cast<MDNode>(Tag->getOperand(1));
318Metadata *OffsetNode =Tag->getOperand(2);
319uint64_tOffset = mdconst::extract<ConstantInt>(OffsetNode)->getZExtValue();
320
321bool NewFormat = isa<MDNode>(AccessType->getOperand(0));
322
323// See if the tag is already mutable.
324unsigned ImmutabilityFlagOp = NewFormat ? 4 : 3;
325if (Tag->getNumOperands() <= ImmutabilityFlagOp)
326returnTag;
327
328// If Tag is already mutable then return it.
329Metadata *ImmutabilityFlagNode =Tag->getOperand(ImmutabilityFlagOp);
330if (!mdconst::extract<ConstantInt>(ImmutabilityFlagNode)->getValue())
331returnTag;
332
333// Otherwise, create another node.
334if (!NewFormat)
335returncreateTBAAStructTagNode(BaseType, AccessType,Offset);
336
337Metadata *SizeNode =Tag->getOperand(3);
338uint64_tSize = mdconst::extract<ConstantInt>(SizeNode)->getZExtValue();
339returncreateTBAAAccessTag(BaseType, AccessType,Offset,Size);
340}
341
342MDNode *MDBuilder::createIrrLoopHeaderWeight(uint64_t Weight) {
343Metadata *Vals[] = {
344createString("loop_header_weight"),
345createConstant(ConstantInt::get(Type::getInt64Ty(Context), Weight)),
346 };
347returnMDNode::get(Context, Vals);
348}
349
350MDNode *MDBuilder::createPseudoProbeDesc(uint64_t GUID,uint64_t Hash,
351StringRef FName) {
352auto *Int64Ty =Type::getInt64Ty(Context);
353SmallVector<Metadata *, 3> Ops(3);
354 Ops[0] =createConstant(ConstantInt::get(Int64Ty, GUID));
355 Ops[1] =createConstant(ConstantInt::get(Int64Ty, Hash));
356 Ops[2] =createString(FName);
357returnMDNode::get(Context, Ops);
358}
359
360MDNode *
361MDBuilder::createLLVMStats(ArrayRef<std::pair<StringRef, uint64_t>> LLVMStats) {
362auto *Int64Ty =Type::getInt64Ty(Context);
363SmallVector<Metadata *, 4> Ops(LLVMStats.size() * 2);
364for (size_tI = 0;I < LLVMStats.size();I++) {
365 Ops[I * 2] =createString(LLVMStats[I].first);
366 Ops[I * 2 + 1] =
367createConstant(ConstantInt::get(Int64Ty, LLVMStats[I].second));
368 }
369returnMDNode::get(Context, Ops);
370}
SelectTypeKind::Int1
@ Int1
isConstant
static bool isConstant(const MachineInstr &MI)
Definition:AMDGPUInstructionSelector.cpp:2862
Arguments
AMDGPU Lower Kernel Arguments
Definition:AMDGPULowerKernelArguments.cpp:504
Constants.h
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Domain
Domain
Definition:CorrelatedValuePropagation.cpp:744
Name
std::string Name
Definition:ELFObjHandler.cpp:77
Size
uint64_t Size
Definition:ELFObjHandler.cpp:81
Function.h
F
#define F(x, y, z)
Definition:MD5.cpp:55
I
#define I(x, y, z)
Definition:MD5.cpp:58
MDBuilder.h
Metadata.h
This file contains the declarations for metadata subclasses.
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Int64
@ Int64
Definition:TargetLibraryInfo.cpp:69
BaseType
llvm::APInt
Class for arbitrary precision integers.
Definition:APInt.h:78
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition:ArrayRef.h:41
llvm::ArrayRef::size
size_t size() const
size - Get the array size.
Definition:ArrayRef.h:168
llvm::ConstantAsMetadata
Definition:Metadata.h:525
llvm::ConstantAsMetadata::get
static ConstantAsMetadata * get(Constant *C)
Definition:Metadata.h:532
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition:Constants.h:83
llvm::Constant
This is an important base class in LLVM.
Definition:Constant.h:42
llvm::DWARFExpression::Operation
This class represents an Operation in the Expression.
Definition:DWARFExpression.h:32
llvm::DenseSet
Implements a dense probed hash-table based set.
Definition:DenseSet.h:278
llvm::Function
Definition:Function.h:63
llvm::IntegerType
Class to represent integer types.
Definition:DerivedTypes.h:42
llvm::IntegerType::get
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
Definition:Type.cpp:311
llvm::MDBuilder::createTBAAAccessTag
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,...
Definition:MDBuilder.cpp:301
llvm::MDBuilder::createCallbackEncoding
MDNode * createCallbackEncoding(unsigned CalleeArgNo, ArrayRef< int > Arguments, bool VarArgsArePassed)
Return metadata describing a callback (see llvm::AbstractCallSite).
Definition:MDBuilder.cpp:118
llvm::MDBuilder::createAnonymousAARoot
MDNode * createAnonymousAARoot(StringRef Name=StringRef(), MDNode *Extra=nullptr)
Return metadata appropriate for a AA root node (scope or TBAA).
Definition:MDBuilder.cpp:194
llvm::MDBuilder::createFunctionEntryCount
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...
Definition:MDBuilder.cpp:71
llvm::MDBuilder::createPseudoProbeDesc
MDNode * createPseudoProbeDesc(uint64_t GUID, uint64_t Hash, StringRef FName)
Return metadata containing the pseudo probe descriptor for a function.
Definition:MDBuilder.cpp:350
llvm::MDBuilder::createConstant
ConstantAsMetadata * createConstant(Constant *C)
Return the given constant as metadata.
Definition:MDBuilder.cpp:24
llvm::MDBuilder::createFPMath
MDNode * createFPMath(float Accuracy)
Return metadata with the given settings.
Definition:MDBuilder.cpp:28
llvm::MDBuilder::createPCSections
MDNode * createPCSections(ArrayRef< PCSection > Sections)
Return metadata for PC sections.
Definition:MDBuilder.cpp:173
llvm::MDBuilder::createTBAANode
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,...
Definition:MDBuilder.cpp:218
llvm::MDBuilder::createTBAARoot
MDNode * createTBAARoot(StringRef Name)
Return metadata appropriate for a TBAA root node with the given name.
Definition:MDBuilder.cpp:212
llvm::MDBuilder::createBranchWeights
MDNode * createBranchWeights(uint32_t TrueWeight, uint32_t FalseWeight, bool IsExpected=false)
Return metadata containing two branch weights.
Definition:MDBuilder.cpp:37
llvm::MDBuilder::createString
MDString * createString(StringRef Str)
Return the given string as metadata.
Definition:MDBuilder.cpp:20
llvm::MDBuilder::createTBAAScalarTypeNode
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...
Definition:MDBuilder.cpp:265
llvm::MDBuilder::createIrrLoopHeaderWeight
MDNode * createIrrLoopHeaderWeight(uint64_t Weight)
Return metadata containing an irreducible loop header weight.
Definition:MDBuilder.cpp:342
llvm::MDBuilder::createFunctionSectionPrefix
MDNode * createFunctionSectionPrefix(StringRef Prefix)
Return metadata containing the section prefix for a function.
Definition:MDBuilder.cpp:90
llvm::MDBuilder::createUnpredictable
MDNode * createUnpredictable()
Return metadata specifying that a branch or switch is unpredictable.
Definition:MDBuilder.cpp:69
llvm::MDBuilder::createTBAAStructTypeNode
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,...
Definition:MDBuilder.cpp:251
llvm::MDBuilder::createCallees
MDNode * createCallees(ArrayRef< Function * > Callees)
Return metadata indicating the possible callees of indirect calls.
Definition:MDBuilder.cpp:111
llvm::MDBuilder::createAliasScopeDomain
MDNode * createAliasScopeDomain(StringRef Name)
Return metadata appropriate for an alias scope domain node with the given name.
Definition:MDBuilder.cpp:228
llvm::MDBuilder::createRange
MDNode * createRange(const APInt &Lo, const APInt &Hi)
Return metadata describing the range [Lo, Hi).
Definition:MDBuilder.cpp:95
llvm::MDBuilder::createLikelyBranchWeights
MDNode * createLikelyBranchWeights()
Return metadata containing two branch weights, with significant bias towards true destination.
Definition:MDBuilder.cpp:42
llvm::MDBuilder::createTBAAStructNode
MDNode * createTBAAStructNode(ArrayRef< TBAAStructField > Fields)
Return metadata for a tbaa.struct node with the given struct field descriptions.
Definition:MDBuilder.cpp:238
llvm::MDBuilder::mergeCallbackEncodings
MDNode * mergeCallbackEncodings(MDNode *ExistingCallbacks, MDNode *NewCB)
Merge the new callback encoding NewCB into ExistingCallbacks.
Definition:MDBuilder.cpp:135
llvm::MDBuilder::createMutableTBAAAccessTag
MDNode * createMutableTBAAAccessTag(MDNode *Tag)
Return mutable version of the given mutable or immutable TBAA access tag.
Definition:MDBuilder.cpp:315
llvm::MDBuilder::createLLVMStats
MDNode * createLLVMStats(ArrayRef< std::pair< StringRef, uint64_t > > LLVMStatsVec)
Return metadata containing llvm statistics.
Definition:MDBuilder.cpp:361
llvm::MDBuilder::createRTTIPointerPrologue
MDNode * createRTTIPointerPrologue(Constant *PrologueSig, Constant *RTTI)
Return metadata feeding to the CodeGen about how to generate a function prologue for the "function" s...
Definition:MDBuilder.cpp:165
llvm::MDBuilder::createUnlikelyBranchWeights
MDNode * createUnlikelyBranchWeights()
Return metadata containing two branch weights, with significant bias towards false destination.
Definition:MDBuilder.cpp:47
llvm::MDBuilder::createAliasScope
MDNode * createAliasScope(StringRef Name, MDNode *Domain)
Return metadata appropriate for an alias scope node with the given name.
Definition:MDBuilder.cpp:232
llvm::MDBuilder::createTBAAStructTagNode
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 ...
Definition:MDBuilder.cpp:274
llvm::MDBuilder::createTBAATypeNode
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,...
Definition:MDBuilder.cpp:285
llvm::MDNode
Metadata node.
Definition:Metadata.h:1073
llvm::MDNode::replaceOperandWith
void replaceOperandWith(unsigned I, Metadata *New)
Replace a specific operand.
Definition:Metadata.cpp:1077
llvm::MDNode::getDistinct
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition:Metadata.h:1557
llvm::MDNode::getOperand
const MDOperand & getOperand(unsigned I) const
Definition:Metadata.h:1434
llvm::MDNode::get
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition:Metadata.h:1549
llvm::MDNode::getNumOperands
unsigned getNumOperands() const
Return number of MDNode operands.
Definition:Metadata.h:1440
llvm::MDString
A single uniqued string.
Definition:Metadata.h:724
llvm::MDString::get
static MDString * get(LLVMContext &Context, StringRef Str)
Definition:Metadata.cpp:606
llvm::Metadata
Root of the metadata hierarchy.
Definition:Metadata.h:62
llvm::SmallVectorBase::empty
bool empty() const
Definition:SmallVector.h:81
llvm::SmallVectorBase::size
size_t size() const
Definition:SmallVector.h:78
llvm::SmallVectorImpl::reserve
void reserve(size_type N)
Definition:SmallVector.h:663
llvm::SmallVectorImpl::resize
void resize(size_type N)
Definition:SmallVector.h:638
llvm::SmallVectorTemplateBase::push_back
void push_back(const T &Elt)
Definition:SmallVector.h:413
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition:SmallVector.h:1196
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition:Type.h:45
llvm::Type::getInt1Ty
static IntegerType * getInt1Ty(LLVMContext &C)
llvm::Type::getInt32Ty
static IntegerType * getInt32Ty(LLVMContext &C)
llvm::Type::getInt64Ty
static IntegerType * getInt64Ty(LLVMContext &C)
llvm::Type::getFloatTy
static Type * getFloatTy(LLVMContext &C)
llvm::detail::DenseSetImpl::end
iterator end()
Definition:DenseSet.h:182
llvm::detail::DenseSetImpl::begin
iterator begin()
Definition:DenseSet.h:181
uint32_t
uint64_t
unsigned
llvm::CallingConv::C
@ C
The default llvm calling convention, compatible with C.
Definition:CallingConv.h:34
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::Offset
@ Offset
Definition:DWP.cpp:480
llvm::sort
void sort(IteratorTy Start, IteratorTy End)
Definition:STLExtras.h:1664
llvm::PackElem::Hi
@ Hi
llvm::PackElem::Lo
@ Lo
llvm::HighlightColor::Tag
@ Tag

Generated on Sun Jul 20 2025 09:42:02 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp