31 assert(Accuracy > 0.0 &&
"Invalid fpmath accuracy!");
38 uint32_t FalseWeight) {
39 uint32_t Weights[] = {TrueWeight, FalseWeight};
44 assert(Weights.
size() >= 2 &&
"Need at least two branch weights!");
50 for (
unsigned i = 0, e = Weights.
size(); i != e; ++i)
137 for (
unsigned i = 0, e = Fields.
size(); i != e; ++i) {
140 Vals[i * 3 + 2] = Fields[i].TBAA;
152 for (
unsigned i = 0, e = Fields.size(); i != e; ++i) {
153 Ops[i * 2 + 1] = Fields[i].first;
171 uint64_t Offset,
bool IsConstant) {
174 Metadata *Ops[4] = {BaseType, AccessType,
179 Metadata *Ops[3] = {BaseType, AccessType,
void push_back(const T &Elt)
MDNode * createRange(const APInt &Lo, const APInt &Hi)
Return metadata describing the range [Lo, Hi).
MDNode * createAnonymousAARoot(StringRef Name=StringRef(), MDNode *Extra=nullptr)
Return metadata appropriate for a AA root node (scope or TBAA).
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)
static IntegerType * getInt64Ty(LLVMContext &C)
MDNode * createFPMath(float Accuracy)
Return metadata with the given settings.
static Type * getFloatTy(LLVMContext &C)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
size_t size() const
size - Get the array size.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
unsigned getBitWidth() const
Return the number of bits in the APInt.
MDNode * createAliasScopeDomain(StringRef Name)
Return metadata appropriate for an alias scope domain node with the given name.
MDNode * createFunctionEntryCount(uint64_t Count)
Return metadata containing the entry count for a function.
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...
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)
get() - This returns a ConstantFP, or a vector containing a splat of a ConstantFP, for the specified value in the specified type.
Class for arbitrary precision integers.
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
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.
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'.
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.
bool empty() const
empty - Check if the string is empty.