32 assert(Accuracy > 0.0 &&
"Invalid fpmath accuracy!");
44 assert(Weights.
size() >= 1 &&
"Need at least one branch weights!");
50 for (
unsigned i = 0, e = Weights.
size(); i != e; ++i)
61 uint64_t Count,
bool Synthetic,
72 std::stable_sort(OrderID.begin(), OrderID.end(),
75 for (
auto ID : OrderID)
116 Args.push_back(Extra);
161 for (
unsigned i = 0, e = Fields.
size(); i != e; ++i) {
164 Vals[i * 3 + 2] = Fields[i].Type;
176 for (
unsigned i = 0, e = Fields.size(); i != e; ++i) {
177 Ops[i * 2 + 1] = Fields[i].first;
195 uint64_t
Offset,
bool IsConstant) {
213 for (
unsigned I = 0,
E = Fields.
size();
I !=
E; ++
I) {
214 Ops[
I * 3 + 3] = Fields[
I].Type;
230 ImmutabilityFlagNode});
239 uint64_t
Offset = mdconst::extract<ConstantInt>(OffsetNode)->getZExtValue();
241 bool NewFormat = isa<MDNode>(AccessType->getOperand(0));
244 unsigned ImmutabilityFlagOp = NewFormat ? 4 : 3;
250 if (!mdconst::extract<ConstantInt>(ImmutabilityFlagNode)->getValue())
258 uint64_t
Size = mdconst::extract<ConstantInt>(SizeNode)->getZExtValue();
MDNode * createRange(const APInt &Lo, const APInt &Hi)
Return metadata describing the range [Lo, Hi).
static bool isConstant(const MachineInstr &MI)
MDNode * createAnonymousAARoot(StringRef Name=StringRef(), MDNode *Extra=nullptr)
Return metadata appropriate for a AA root node (scope or TBAA).
MDNode * createUnpredictable()
Return metadata specifying that a branch or switch is unpredictable.
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
This class represents lattice values for constants.
ConstantAsMetadata * createConstant(Constant *C)
Return the given constant as metadata.
void replaceOperandWith(unsigned I, Metadata *New)
Replace a specific operand.
static MDString * get(LLVMContext &Context, StringRef Str)
Implements a dense probed hash-table based set.
void push_back(const T &Elt)
const MDOperand & getOperand(unsigned I) const
static IntegerType * getInt64Ty(LLVMContext &C)
MDNode * createFPMath(float Accuracy)
Return metadata with the given settings.
unsigned getBitWidth() const
Return the number of bits in the APInt.
MDNode * createIrrLoopHeaderWeight(uint64_t Weight)
Return metadata containing an irreducible loop header weight.
MDNode * createFunctionEntryCount(uint64_t Count, bool Synthetic, const DenseSet< GlobalValue::GUID > *Imports)
Return metadata containing the entry Count for a function, a boolean indicating whether the counts w...
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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, offset of the access relative to the base type, size of the access and flag indicating whether the accessed object can be considered immutable for the purposes of the TBAA analysis.
static Type * getFloatTy(LLVMContext &C)
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata *> MDs)
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, size in bytes, type identifier and a list of fields.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata *> MDs)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
The instances of the Type class are immutable: once they are created, they are never changed...
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
MDNode * createAliasScopeDomain(StringRef Name)
Return metadata appropriate for an alias scope domain node with the given name.
Class to represent integer types.
MDNode * createTBAAStructNode(ArrayRef< TBAAStructField > Fields)
Return metadata for a tbaa.struct node with the given struct field descriptions.
MDNode * createBranchWeights(uint32_t TrueWeight, uint32_t FalseWeight)
Return metadata containing two branch weights.
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...
BaseType
A given derived pointer can have multiple base pointers through phi/selects.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
This is the shared class of boolean and integer constants.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
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.
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...
Class for arbitrary precision integers.
MDNode * createCallees(ArrayRef< Function *> Callees)
Return metadata indicating the possible callees of indirect calls.
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...
static IntegerType * getInt32Ty(LLVMContext &C)
MDString * createString(StringRef Str)
Return the given string as metadata.
MDNode * createAliasScope(StringRef Name, MDNode *Domain)
Return metadata appropriate for an alias scope node with the given name.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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 ...
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, and value for 'pointsToConstantMemory'.
MDNode * createFunctionSectionPrefix(StringRef Prefix)
Return metadata containing the section prefix for a function.
StringRef - Represent a constant reference to a string, i.e.
MDNode * createTBAARoot(StringRef Name)
Return metadata appropriate for a TBAA root node with the given name.
unsigned getNumOperands() const
Return number of MDNode operands.
MDNode * createMutableTBAAAccessTag(MDNode *Tag)
Return mutable version of the given mutable or immutable TBAA access tag.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.