Represent a constant reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take consecutive elements easily and conveniently.
Synopsis
Declared in <llvm/ADT/ArrayRef.h>
template<typename T>
class [[nodiscard]] ArrayRef;
Description
This class does not own the underlying data, it is expected to be used in situations where the data resides in some other buffer, whose lifetime extends past that of the ArrayRef. For this reason, it is not in general safe to store an ArrayRef.
This is intended to be trivially copyable, so it should be passed by value.
Type Aliases
Name |
Description |
Const iterator over the referenced array elements. |
|
Pointer to a const element. |
|
Const reference to an element. |
|
Const reverse iterator over the referenced array elements. |
|
Signed type used to express distances between iterators. |
|
Iterator over the referenced array elements. |
|
Mutable pointer to an element. |
|
Mutable reference to an element. |
|
Reverse iterator over the referenced array elements. |
|
Unsigned type used to express the size of the array. |
|
Element type stored in the referenced array. |
Member Functions
Name |
Description |
|
Constructors |
Disallow accidental assignment from a temporary. |
|
Get the last element. |
|
Return an iterator to the first element. |
|
consume_back() ‐ Returns the last element and drops it from ArrayRef. |
|
consume_front() ‐ Returns the first element and drops it from ArrayRef. |
|
Allocate a mutable copy in |
|
Return a pointer to the first element of the array. |
|
Drop the last |
|
Drop the first |
|
Return a copy of *this with the first N elements not satisfying the given predicate removed. |
|
Return a copy of *this with the first N elements satisfying the given predicate removed. |
|
Check if the array is empty. |
|
Return an iterator past the last element. |
|
Check for element‐wise equality. |
|
Get the first element. |
|
@} |
|
Return a reverse iterator to the last element. |
|
Return a reverse iterator to the element before the first element. |
|
Get the array size. |
|
|
|
Return a copy of *this with only the last |
|
Return a copy of *this with only the first |
|
Return the first N elements of this Array that don't satisfy the given predicate. |
|
Return the first N elements of this Array that satisfy the given predicate. |
|
@} |
|
@} |
Specializations
Name |
Description |
Represent a constant reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take consecutive elements easily and conveniently. |
|
Represent a constant reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take consecutive elements easily and conveniently. |
|
|
Represent a constant reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take consecutive elements easily and conveniently. |
|
Represent a constant reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take consecutive elements easily and conveniently. |
Deduction Guides
Name |
Description |
Deduction guide to construct an ArrayRef from an ArrayRef |
|
@{ Deduction guide to construct an ArrayRef from a single element. |
|
Deduction guide to construct an ArrayRef from an ArrayRef (const) |
|
Deduction guide to construct an ArrayRef from a SmallVector |
|
Deduction guide to construct an ArrayRef from a std::vector |
|
Deduction guide to construct an ArrayRef from a SmallVector |
|
Deduction guide to construct an ArrayRef from a std::array |
|
Deduction guide to construct an ArrayRef from a C array. |
|
Deduction guide to construct an ArrayRef from a pointer and length |
|
Deduction guide to construct an ArrayRef from a range |
Non-Member Functions
Name |
Description |
Determine the edit distance between two sequences. |
|
Determine the edit distance between two sequences. |
|
Find in type conversion cost table. |
|
Find in cost table. |
|
Delete the specified blocks from |
|
Promote the specified list of alloca instructions into scalar registers, inserting PHI nodes as appropriate. |
|
Construct an array ref of bytes from a string ref. |
|
Check if the values in |
|
Clone the specified noalias decl scopes. Then adapt all instructions in the [IStart, IEnd]included !) range to the cloned versions. 'Ext' will be added to the duplicate scope names. |
|
Clone the specified noalias decl scopes. Then adapt all instructions in the NewBlocks basicblocks to the cloned versions. 'Ext' will be added to the duplicate scope names. |
|
Duplicate the specified list of noalias decl scopes. The 'Ext' string is added as an extension to the name. Afterwards, the ClonedScopes contains the mapping of the original scope MDNode onto the cloned scope. Be aware that the cloned scopes are still part of the original scope domain. |
|
Given a vector of strings (names of global objects like functions or, virtual tables) |
|
Produce |
|
Compute a map of integer instructions to their minimum legal type size. |
|
Converts a UTF16 string into a UTF8 std::string. |
|
Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string. |
|
Converts a stream of raw bytes assumed to be UTF32 into a UTF8 std::string. |
|
Converts a UTF32 string into a UTF8 std::string. |
|
Replace constant expressions users of the given constants with instructions. Return whether anything was changed. |
|
Create a DAG scheduling mutation to pair instructions back to back for instructions that benefit according to the target‐specific predicate functions. shouldScheduleAdjacent will be true if any of the provided predicates are true. If BranchOnly is true, only branch instructions with one of their predecessors will be fused. |
|
When a loop exit edge is split, LCSSA form may require new PHIs in the new exit block. This function inserts the new PHIs, as needed. Preds is a list of preds inside the loop, SplitBB is the new loop exit block, and DestBB is the old loop exit, now the successor of SplitBB. |
|
Given a shuffle mask for a binary shuffle, create the equivalent shuffle mask assuming both operands are identical. This assumes that the unary shuffle will use elements from operand 0 (operand 1 will be unused). |
|
Replace contents of every block in |
|
downscale the given weights preserving the ratio. If the maximum value is not already known and not provided via |
|
Convert `Bytes' to a hex string and output to `OS' |
|
Push the weights right to fit in uint32_t. |
|
Format |
|
Format |
|
Convenience function for recomputing live‐in's for a set of MBBs until the computation converges. |
|
Returns the types contained in |
|
Repetitively apply |
|
Computes a SipHash‐2‐4 128‐bit result. |
|
Computes a SipHash‐2‐4 64‐bit result. |
|
If all non‐negative |
|
Returns true if a blob of text starts with a UTF‐16 big or little endian byte order mark. |
|
@} |
|
Find the 'llvm.experimental.noalias.scope.decl' intrinsics in the specified basic blocks and extract their scope. These are candidates for duplication when cloning. |
|
Does this shuffle mask represent either one slide shuffle or a pair of two slide shuffles, combined with a select on some constant vector mask? A slide is a shuffle mask which shifts some set of elements up or down the vector, with all other elements being undefined. An identity shuffle will be matched a slide by 0. The output parameter provides the source (‐1 means no source), and slide direction for each slide. |
|
Return true if |
|
Lexicographically compare two `ArrayRef`s. |
|
Return true if |
|
Return true if |
|
Lexicographically compare two `ArrayRef`s. |
|
Return true if |
|
Splits and processes shuffle mask depending on the number of input and output registers. The function does 2 main things: 1) splits the source/destination vectors into real registers; 2) do the mask analysis to identify which real registers are permuted. Then the function processes resulting registers mask using provided action items. If no input register is defined, |
|
Remaps instructions in |
|
Attempt to sort the pointers in |
|
Combine the hashes in |
|
Convert buffer |
|
Convert the bytes in |
|
Construct a string ref from an array ref of unsigned chars. |
|
Construct a string ref from an array ref of chars. |
|
A variant of the previous method which is specialized for Scale=2, and treats ‐1 as undef and allows widening when a wider element is partially undef in the narrow form of the mask. This transformation discards information about which bytes in the original shuffle were undef. |
|
Compute the XXH3 128‐bit hash of the bytes in |
|
Inline ArrayRef overloads of the xxhash entry points declared out‐of‐line in llvm/Support/xxhash.h. They live here so xxhash.h can stay free of ADT dependencies. |
|
Encodes the BBAddrMap payload into |
|
Check if a value is contained in any of the intervals. |
|
|
Merge adjacent/consecutive intervals into single intervals. Example: [1‐3, 4‐6, 8‐10]‐> [1‐6, 8‐10]. |
Fill the IIT table descriptor for the intrinsic |
|
Parse a V3 UNWIND_INFO from raw bytes. Returns an error on malformed data. |
|
Decode one WOD from the pool at the given byte offset. Returns an error on malformed data. |
|
Merge the codegen data from the scratch objects |
|
Mark all options not part of the categories as cl::ReallyHidden. |
|
An array of optional enabled settings in the LLVM build configuration, which may be of interest to compiler developers. For example, includes "+assertions" if assertions are enabled. Used by printBuildConfig. |
|
Estimate the "quality" of a given node order in CFG. The higher the score, the better the order is. The score is designed to reflect the locality of the given order, which is anti‐correlated with the number of I‐cache misses in a typical execution of the function. |
|
Estimate the "quality" of the current node order in CFG. |
|
Apply a Cache‐Directed Sort for functions represented by a call graph. The placement is done by optimizing the call locality by co‐locating frequently executed functions. |
|
Find a layout of nodes (basic blocks) of a given CFG optimizing jump locality and thus processor I‐cache utilization. This is achieved via increasing the number of fall‐through jumps and co‐locating frequently executed nodes together. The nodes are assumed to be indexed by integers from [0, |V|) so that the] current order is the identity permutation. |
|
Reinterpret a byte array as an array of characters. Does not interpret as a C string, as StringRef has several helpers (split) that make that easy. |
|
Take an optional DWARFFormValue and try to extract block data. |
|
Fills in Symtab and StrtabBuilder with a valid symbol and string table for Mods. |
|
Produces a container ordering for optimal multi‐threaded processing. Returns ordered indices to elements in the input array. |
|
Build callstack metadata from the provided list of call stack ids. Returns the resulting metadata node. |
|
Helper to generate a single hash id for a given callstack, used for emitting matching statistics and useful for uniquing such statistics across modules. Also used to dedup contexts when computing the summary. |
|
Convenience function for creating a search order from an ArrayRef of JITDylib*, all with the same flags. |
|
Serialize |
|
Run deallocation actions. Dealloc actions will be run in reverse order (from last element of DAs to first). |
Derived Classes
Name |
Description |
Represent a mutable reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take and modify consecutive elements easily and conveniently. |
Return Value
|
Note
|
The return value should not be discarded. |
Created with MrDocs