A FUNCTION_BLOCK (block 12) holds one function body: a count of basic blocks, then a
record for each instruction, with debug-location records in between. The operand layouts
below are the ones BitcodeReader::parseFunctionBody reads
(BitcodeReader.cpp, lines 5137–7259) checked against the ones the writer
emits (writeInstruction, BitcodeWriter.cpp lines 3294–3778).
The codes and the tables of opcodes, flags and predicates are on
functions and constants.
Value IDs and types
Numbering
Values in a function are numbered in one sequence that continues the module’s: the
global values and module constants, then the function’s arguments, then the constants
of its own CONSTANTS block, then every instruction that produces a value (an instruction of
type void takes no number). InstNum below is the number the current
instruction would get if it produces a value.
Relative IDs and the forward-reference type
From module version 1 a value operand is written as InstNum − ID, in an
unsigned 32-bit word. The reader computes ID = InstNum − operand
(getValueTypePair, lines 782–806; the writer’s pushValue is
lines 3280–3284). For a value defined earlier the difference is positive and small. A
forward reference, a value whose ID is not yet defined, wraps to a very large
number, the ID comes out at or above InstNum, and then:
- an operand written with its type (value+type in the tables) is followed by a type ID, which the reader uses to make a placeholder value. If the record ends there, the reader reports the operand as invalid;
- for a value earlier than InstNum no type follows: the reader takes the type from the value, so the record is shorter by one operand;
- an operand written without a type (value) never has one, even for a forward reference; its type is known from an earlier operand. A forward reference there is resolved against that type. These are the second operand of a binary operator or comparison, the fixed arguments of a call and the others marked in the tables.
Module version 0 uses absolute IDs instead (ID = operand); the same rule
applies, a type follows when the ID is at or above InstNum.
Some operands are not relative. Basic block numbers (0 for the first block)
and type IDs are plain numbers. The size operand of
alloca and the case values of switch are absolute
value IDs. PHI values are relative but signed: a sign-rotated number (the
difference doubled, with the low bit set when it is negative), because a forward
reference gives a negative difference. A metadata argument of a call (a
parameter of type metadata) is written as InstNum − metadata ID.
Blocks and end of function
DECLAREBLOCKS [n]must come first. An empty record or 0 isInvalid declareblocks record. Instructions fill block 0, then each terminator (ret, br, switch, indirectbr, invoke, resume, unreachable, cleanupret, catchret, catchswitch, callbr) moves to the next block. An instruction with no current block, because DECLAREBLOCKS is missing or the blocks have run out, isInvalid instruction with no BB.- A record code the reader does not know is
Invalid value: unknown records are not skipped in this block. - At the end a forward-referenced value that was never defined is
Never resolved value found in function. - Sub-blocks of a function: CONSTANTS, VALUE_SYMTAB, METADATA_ATTACHMENT, METADATA and
USELIST; any other is skipped. A stream error is
Malformed block.
Records
In the operand lists, value+type is a relative value that is followed by a
type ID only when it is a forward reference (see above), value is a relative value
with no type, bb is a basic block number and type is a type ID.
[…]? is optional. An operand list the reader finds too short, or with a value
of the wrong type, gives the error named for the record (usually Invalid
name record); only messages with other wording are quoted.
| Code | Record | Operands as read | Notes |
|---|---|---|---|
1 | DECLAREBLOCKS | [n] | The number of basic blocks. |
2 | INST_BINOP | [lhs value+type, rhs value, opcode, flags?] | Result type is the left operand’s. The opcode must be valid for the type (floating-point types allow only add, sub, mul, sdiv, srem, which become fadd, fsub, fmul, fdiv, frem), or Invalid binary operator record. Flags: add, sub, mul, shl: bit 0 no unsigned wrap, bit 1 no signed wrap; udiv, sdiv, lshr, ashr: bit 0 exact; or: bit 0 disjoint; floating-point: fast-math flags. |
3 | INST_CAST | [value+type, destination type, opcode, flags?] | Invalid cast record or Invalid cast if the opcode is unknown or the cast is not allowed. Flags: zext and uitofp bit 0 nneg (for uitofp the fast-math flags are in the bits above bit 0, shifted left one); trunc bit 0 no unsigned wrap, bit 1 no signed wrap; addrspacecast bit 0 non-null. |
4 | INST_GEP_OLD | [base value+type, index value+type…] | Old form. The source element type is taken from the base pointer’s type. |
5 | INST_SELECT | [true value+type, false value, condition value] | Old form; the condition is i1. |
6 | INST_EXTRACTELT | [vector value+type, index value+type] | The first operand must be a vector (Invalid type for value). |
7 | INST_INSERTELT | [vector value+type, element value, index value+type] | The element has the vector’s element type. |
8 | INST_SHUFFLEVEC | [vector 1 value+type, vector 2 value, mask value+type] | Both vectors must be vectors. The mask is a constant; the writer writes it as a value without a type (getShuffleMaskForBitcode, lines 3400–3406), and a forward reference to it would carry one. |
9 | INST_CMP | [lhs value+type, rhs value, predicate, flags?] | Old form of code 28; the same layout. |
10 | INST_RET | [] or [value+type] | An empty record is ret void. Operands left over after the value: Invalid ret record. |
11 | INST_BR | [bb] or [true bb, false bb, condition value] | Exactly 1 or 3 operands, or Invalid br record. The condition is i1 and has no type operand. |
12 | INST_SWITCH | [type, condition value, default bb, (case value ID, bb)…] | Case values are absolute value IDs of constants. The record has an odd number of operands, at least 3. An old format for case ranges is recognised when operand0 >> 16 == 0x4B5; see below. |
13 | INST_INVOKE | [attributes, calling conv, normal bb, unwind bb, function type?, callee value+type, fixed argument values…, varargs value+type…] | At least 4 operands. Calling conv is a word: bits 0 to 9 the convention and bit 13 “explicit function type” (the writer always sets it). Without the type the reader takes it from the callee pointer’s old element type. Errors: Explicit invoke type is not a function type, Callee is not a pointer, Callee is not of pointer to function type, Insufficient operands to call, Invalid invoke record. |
15 | INST_UNREACHABLE | — | |
16 | INST_PHI | [type, (signed relative value, bb)…, flags?] | An odd count after the type is allowed only for a floating-point phi, where the last operand is fast-math flags. Invalid phi record, Invalid phi BB. With module version 0 the values are absolute and unsigned. |
19 | INST_ALLOCA | [allocated type, size type, size value ID, flags, address space?] | Exactly 4 or 5 operands (Invalid alloca record). The size is an absolute value ID. Flags word. Without an explicit type the allocated type is taken from the pointer type. alloca of unsized type if there is no alignment and the type is unsized; alloca element count must have integer type. The address space defaults to the data layout’s alloca address space. |
20 | INST_LOAD | [pointer value+type, type?, alignment, volatile] | With the loaded type present the record has 3 operands after the pointer; the older form has 2 and takes the type from the pointer. Alignment is exponent plus 1 (alignment); 0 means the type’s ABI alignment. Load operand is not a pointer type, Missing load type, load of unsized type. |
23 | INST_VAARG | [va_list type, va_list value, result type] | At least 3 operands. |
24 | INST_STORE_OLD | [pointer value+type, value, alignment, volatile] | The stored value’s type comes from the pointer’s element type. |
26 | INST_EXTRACTVAL | [aggregate value+type, index…] | Indices are literal numbers. At least one: EXTRACTVAL: Invalid instruction with 0 indices. The type at each step must be a struct or array and the index in range (EXTRACTVAL: Invalid type, … Invalid struct index, … Invalid array index). |
27 | INST_INSERTVAL | [aggregate value+type, value value+type, index…] | The same checks (INSERTVAL: …), and Inserted value type doesn't match aggregate type. |
28 | INST_CMP2 | [lhs value+type, rhs value, predicate, flags?] | Result i1 or a vector of i1. For floating-point operands the optional word is fast-math flags and the predicate must be a floating-point one (Invalid fcmp predicate); for integers the word has bit 0 samesign and the predicate an integer one (Invalid icmp predicate). A longer record is Invalid comparison record. Predicates. |
29 | INST_VSELECT | [true value+type, false value, condition value+type, flags?] | The condition is i1 or a vector of i1 (Invalid type for value). Flags are fast-math flags for a floating-point result. The writer’s order is true, false, condition (lines 3367–3376). |
30 | INST_INBOUNDS_GEP_OLD | as code 4 | Old form with the inbounds flag implied. |
31 | INST_INDIRECTBR | [type, address value, bb…] | At least 2 operands; every block number must exist. |
33 | DEBUG_LOC_AGAIN | — | The previous instruction gets the same location as the last DEBUG_LOC. Invalid debug_loc_again record if there is no instruction. |
34 | INST_CALL | [attributes, flags, fast-math flags?, function type?, callee value+type, fixed argument values…, varargs value+type…] | At least 3 operands. See call flags. A label parameter takes a basic block number instead of a value. A function that is not variadic must use up every operand (Invalid call record). |
35 | DEBUG_LOC | [line, column, scope, inlined at, implicit code?, atom group?, atom rank?, IR layers?] | Attaches a location to the last instruction. Scope and inlined-at are metadata ID plus 1, 0 for none; scope must be a node (Invalid debug loc record). Operand 4 non-zero marks implicit code. Operands 5 and 6 (atom group and rank) are read only if the record has at least 7 operands; operand 7, a metadata ID plus 1 of IR layers, only with at least 8. At least 4 operands, and a previous instruction. |
36 | INST_FENCE | [ordering, sync scope] | Exactly 2 operands. The ordering must be acquire, release, acq_rel or seq_cst (Invalid fence record). |
37 | INST_CMPXCHG_OLD | [pointer value+type, compare value, new value, volatile, success ordering, sync scope, failure ordering?, weak?] | 3 to 5 operands after the new value. Without a failure ordering the strongest one for the success ordering is used; for a record shorter than 8 operands (no weak flag) the result is only the first member. |
38 | INST_ATOMICRMW_OLD | [pointer value+type, value, operation, volatile, ordering, sync scope, alignment?] | The value’s type comes from the pointer’s element type. |
39 | INST_RESUME | [value+type] | |
40 | INST_LANDINGPAD_OLD | [type, personality value+type, cleanup, clause count, (kind, value+type)…] | At least 4 operands. The personality function is set on the function; a different one later is Personality function mismatch. |
41 | INST_LOADATOMIC | [pointer value+type, type?, alignment, volatile, ordering, sync scope, elementwise?] | Type present when the record has at least 5 operands after the pointer. The ordering must not be notatomic, release or acq_rel; the alignment must be given. An elementwise flag word follows the sync scope in the current writer, when set. |
42 | INST_STOREATOMIC_OLD | [pointer value+type, value, alignment, volatile, ordering, sync scope, elementwise?] | The stored type comes from the pointer. |
43 | INST_GEP | [flags, source element type, base value+type, index value+type…] | GEP flags: bit 0 inbounds, 1 nusw, 2 nuw. Every operand after the type is value+type. |
44 | INST_STORE | [pointer value+type, value value+type, alignment, volatile] | The record must end after the volatile flag (Invalid store record). store of unsized type if there is no alignment and the type is unsized. |
45 | INST_STOREATOMIC | [pointer value+type, value value+type, alignment, volatile, ordering, sync scope, elementwise?] | 4 or 5 operands after the value. The ordering must not be notatomic, acquire or acq_rel; the alignment must be given. |
46 | INST_CMPXCHG | [pointer value+type, compare value+type, new value, volatile, success ordering, sync scope, failure ordering, weak, alignment?] | 3 to 6 operands after the new value. The orderings must be valid for compare-exchange (Invalid cmpxchg success ordering, Invalid cmpxchg failure ordering). Without an alignment the store size of the compared type is used. The result is a struct of the value and an i1. |
47 | INST_LANDINGPAD | [type, cleanup, clause count, (kind, value+type)…] | At least 3 operands. Kind 0 is a catch clause, 1 a filter clause. |
48 | INST_CLEANUPRET | [pad value, unwind bb?] | 1 or 2 operands. The pad is a token, written without a type. |
49 | INST_CATCHRET | [pad value, bb] | Exactly 2 operands. |
50 | INST_CATCHPAD | [parent pad value, argument count, argument value+type…] | At least 2 operands; the arguments must use up the record. Result type token. |
51 | INST_CLEANUPPAD | as code 50 | |
52 | INST_CATCHSWITCH | [parent pad value, handler count, handler bb…, unwind bb?] | At least 2 operands. The unwind block is present when one operand remains after the handlers. Result type token. |
55 | OPERAND_BUNDLE | [tag, input…] | Applies to the next call, invoke or callbr. The tag is an index into the OPERAND_BUNDLE_TAGS block (past the end: Invalid operand bundle record). Each input is a value+type, or the marker 0x80000000 followed by a metadata operand (InstNum − metadata ID). Bundles that no instruction uses give Operand bundles found with no consumer. |
56 | INST_UNOP | [operand value+type, opcode, flags?] | The only opcode is 0 (fneg), for floating-point types. Flags are fast-math flags. |
57 | INST_CALLBR | [attributes, flags, default bb, indirect count, indirect bb…, function type?, callee value+type, fixed argument values…, varargs value+type…] | The convention is (flags & 0x7ff) >> 1 and bit 15 is “explicit type”, as for calls (lines 6215, 6336–6337); the writer emits both (lines 3559–3583). |
58 | INST_FREEZE | [value+type] | No operands may remain. |
59 | INST_ATOMICRMW | [pointer value+type, value value+type, operation, volatile, ordering, sync scope, alignment?] | 4 or 5 operands after the value. The operation is in the low 5 bits; bit 5 (value 32) marks an elementwise operation. The ordering must not be notatomic or unordered. Alignment defaults to the store size of the value’s type. |
60 | BLOCKADDR_USERS | [function value ID…] | Absolute IDs of functions that use the address of one of this function’s blocks. An empty record, or an ID that is not a function, is Invalid blockaddr users record. |
61 | DEBUG_RECORD_VALUE | [location, variable, expression, value metadata] | A #dbg_value attached to the last instruction. The operands are metadata IDs without an added 1. Invalid dbg record: missing instruction with no previous instruction. |
62 | DEBUG_RECORD_DECLARE | [location, variable, expression, location metadata] | A #dbg_declare. |
63 | DEBUG_RECORD_ASSIGN | [location, variable, expression, location metadata, assign ID, address expression, address metadata] | A #dbg_assign. |
64 | DEBUG_RECORD_VALUE_SIMPLE | [location, variable, expression, value] | A #dbg_value whose value is an ordinary relative value, written with no type (a forward reference uses code 61 instead). |
65 | DEBUG_RECORD_LABEL | [location, label] | A #dbg_label. |
66 | DEBUG_RECORD_DECLARE_VALUE | [location, variable, expression, location metadata] | A #dbg_declare_value. |
67 | INST_BITINSERT | [base value+type, value value+type, offset value+type] | A recent instruction. The operand types are checked (Invalid bitinsert record and the reason text of BitInsertInst::areInvalidOperands). Result type is the base’s. Text (LLParser.cpp parseBitInsert, AsmWriter.cpp): %r = bitinsert i32 %a, i8 %v, i32 %off, the base, the inserted value and the bit offset, each with its type; when all three have one type it is written once: bitinsert i32 %a, %b, %c. |
68 | INST_BITEXTRACT | [result type, source value+type, offset value+type] | A recent instruction. Record is empty for bitextract, Invalid bitextract result type, Invalid bitextract record, or the reason from BitExtractInst::areInvalidOperands. Text (parseBitExtract; the writer prints the result type first, as it does for a load): %e = bitextract i8, i32 %r, i8 %v; when the source and the offset have one type it is written once: bitextract i8, i32 %r, %off. The sample newrec-bits.bc holds both forms of each; no LLVM tool before main reads them, so the records were checked with llvm-bcanalyzer and the text against the two source files. |
Codes 14, 17, 18, 21, 22, 25, 32, 53 and 54 are unused and give Invalid value.
Codes 66 to 68 are in LLVMBitCodes.h (lines 715–718) and in the reader
(lines 6943, 5723–5763), which settles the items other pages marked unconfirmed.
Call flags
The second operand of CALL is a word (CallMarkersFlags, LLVMBitCodes.h
lines 608–615):
| Bits | Meaning |
|---|---|
| 0 | tail |
| 1–10 | the calling convention, (flags & 0x7ff) >> 1 |
| 14 | musttail |
| 15 | explicit function type: a type ID follows (and the writer always sets it) |
| 16 | notail |
| 17 | a fast-math flags operand follows. It must not be zero (Fast math flags indicator set for call with no FMF) and the call must return a floating-point type (Fast-math-flags specified for call without floating-point scalar or vector return type). |
INVOKE keeps its own layout: the convention is in bits 0 to 9 with no shift, and the
explicit-type flag is bit 13 (lines 6115–6122, 3487). Without an explicit function type the
reader finds it from the callee’s old pointer type, which does not exist with opaque
pointers; for a callee that is not of that kind the error is
Callee is not of pointer to function type.
The ALLOCA flags word
From AllocaPackedValues in BitcodeCommon.h (lines 21–30) and the
writer (lines 3635–3645):
| Bits | Meaning |
|---|---|
| 0–4 | low 5 bits of the alignment exponent plus 1 |
| 5 | used with inalloca |
| 6 | explicit type: the first operand is the allocated type (the writer always sets it); if clear, it is a pointer type and the element type is used |
| 7 | swifterror |
| 8–10 | high 3 bits of the alignment exponent plus 1, so the exponent is (word & 31) | ((word >> 8) & 7) << 5 |
The case-range switch
A SWITCH record whose first operand shifted right by 16 equals 0x4B5 uses an
encoding with case ranges: [magic word, type, condition, default bb, case count, then for
each case an item count, for each item a flag that says single value or range, then the low
value (and, for a range, the high value) and finally the destination bb]. Values of more
than 64 bits are preceded by a word count and written as sign-rotated words. The comment in
the reader says this was written only by a reverted change but is still recognised (lines
5998–6058).
What the writer emits
- Only the current forms: BINOP, CAST, GEP (43), VSELECT, CMP2, LOAD or LOADATOMIC with the type, STORE or STOREATOMIC with a type on both operands, CMPXCHG (46), ATOMICRMW (59), LANDINGPAD (47), and the CALL, INVOKE and CALLBR layouts above.
- Operands are written in the order shown for the reader, not the order of the header
comments in
LLVMBitCodes.h(for example[lhs, rhs, opcode, flags]for a binary operator). The writer always sets the explicit type bit on calls. - After each instruction that has a debug location, a
DEBUG_LOC_AGAINif it is the same as the last one, otherwise aDEBUG_LOCwith all of the operands; debug records follow the instruction they are attached to; aBLOCKADDR_USERSrecord is written once at the end of the function body; then the VALUE_SYMTAB, METADATA_ATTACHMENT and USELIST blocks. - Abbreviations are used for binary operators, casts, unary operators, loads, stores, GEPs, compares, returns, unconditional and conditional branches, unreachable and debug locations.
More errors of the function block reader
Messages of BitcodeReader.cpp (main branch, read 2026-11-19; line numbers
are that file’s) that are raised for the records on this page and are not named in the
table above, each with its condition. “Operand unreadable” means that
getValueTypePair, popValue or getValue fails: the
operand is missing, its value number points at a value that does not exist, or its type
is wrong. The reader stops at the first error.
| Message | Line | Record | Condition |
|---|---|---|---|
Invalid unary operator record | 5354, 5358 | UNOP | The operand is unreadable or no opcode follows it; or the opcode is not a valid unary opcode for the operand’s type |
Invalid gep record | 5491, 5505 | GEP | The base pointer or any index operand is unreadable |
Invalid extractvalue record | 5546 | EXTRACTVAL | The aggregate operand is unreadable |
Invalid value, EXTRACTVAL: Invalid struct index, EXTRACTVAL: Invalid array index | 5563 to 5567 | EXTRACTVAL | An index does not fit in 32 bits; or it is not below the structure’s or the array’s element count |
Invalid insertvalue record | 5590, 5594 | INSERTVAL | The aggregate or the inserted value is unreadable |
INSERTVAL: Invalid instruction with 0 indices | 5598 | INSERTVAL | No index follows the two operands |
INSERTVAL: Invalid type, Invalid value, INSERTVAL: Invalid struct index, INSERTVAL: Invalid array index | 5608, 5612, 5614 | INSERTVAL | The type being indexed is neither a structure nor an array; an index does not fit in 32 bits; an index is not below the element count |
Invalid select record | 5645 | SELECT (old form, code 5) | The true value, the false value or the i1 condition is unreadable |
Invalid vector select record | 5664 | VSELECT | The true value, the false value or the condition (with its type) is unreadable |
Invalid extractelement record | 5695 | EXTRACTELT | The vector or the index operand is unreadable |
Invalid insertelement record, Invalid insert element record | 5709, 5716 | INSERTELT | The vector operand is unreadable; or the element or the index operand is unreadable (the second message is spelled with a space in the source) |
Invalid shufflevector record | 5773, 5777 | SHUFFLEVEC | The first or second vector, or the mask, is unreadable |
Invalid cleanupret record | 5885, 5891, 5896 | CLEANUPRET | The operand count is not 1 or 2; the cleanup pad token is unreadable; the unwind destination is not a block |
Invalid catchret record | 5905, 5911, 5914 | CATCHRET | The operand count is not 2; the catch pad token is unreadable; the destination is not a block |
Invalid catchswitch record | 5923, 5931, 5939, 5947, 5951 | CATCHSWITCH | Fewer than 2 operands; the parent pad is unreadable; a handler or the unwind destination is not a block; operands are left over after the last one |
Invalid catchpad/cleanuppad record | 5966, 5974, 5983, 5988 | CATCHPAD, CLEANUPPAD | Fewer than 2 operands; the parent pad is unreadable; an argument operand is unreadable; operands are left over |
Invalid switch record | 6013, 6063, 6069, 6079 | SWITCH | The condition type, the condition or the default block is unreadable (new form); in the old form without case ranges, fewer than 3 operands or an even operand count, then the same, or a case value or case block is unreadable |
Invalid indirectbr record | 6088, 6093, 6102 | INDIRECTBR | Fewer than 2 operands; the address type or address is unreadable; a destination is not a block |
Invalid resume record | 6196 | RESUME | The operand is unreadable |
Explicit call type is not a function type | 6219, 7045 | CALLBR, CALL | The explicit-type flag is set and the type ID is not a function type |
Invalid callbr record | 6226, 6252, 6260, 6266 | CALLBR | The callee is unreadable; a fixed argument is unreadable; a non-vararg call has operands left over; a vararg operand is unreadable |
Callee is not a pointer type | 6230, 7056 | CALLBR, CALL | The callee’s type is not a pointer |
callbr argument does not match indirect dest | 6293 | CALLBR | For an argument at an !callbr label position: the argument is not a block address of this function, or the label number is beyond the indirect destinations, or the block differs from that destination |
Invalid landingpad record | 6443, 6447, 6452, 6458, 6479 | LANDINGPAD, LANDINGPAD_OLD | Fewer than 3 operands (old form: fewer than 4); the result type is unknown; the personality function or a clause value is unreadable |
Missing element type for old-style alloca | 6509 | ALLOCA | The explicit-type bit is clear and the pointer type has no recorded element type |
Invalid load record | 6549 | LOAD | The pointer is unreadable, or the operand count after it is not 2 or 3 (type, alignment, volatile) |
Invalid load atomic record, Missing atomic load type, Alignment missing from atomic load | 6588, 6603, 6612, 6614, 6622 | LOADATOMIC | The pointer is unreadable or the operand count after it is not 4, 5 or 6; the old form’s pointee type is unknown; the ordering is not-atomic, release or acq_rel; or the volatile operand is 0 while the ordering is atomic (6614); the alignment operand decodes to none |
Invalid store atomic record, Alignment missing from atomic store | 6674, 6677, 6682, 6686, 6694, 6697, 6703 | STOREATOMIC, STOREATOMIC_OLD | The pointer is unreadable or not a pointer type; the value is unreadable; the operand count after the value is not 4 or 5; the ordering is not-atomic, acquire or acq_rel; the alignment operand is 0 while the ordering is atomic; the alignment decodes to none |
Invalid cmpxchg record, Cmpxchg operand is not a pointer type | 6723, 6726, 6732, 6738, 6744, 6758 (old form); 6791, 6794, 6799, 6804, 6807 (new form) | CMPXCHG_OLD, CMPXCHG | The pointer, comparand or new value is unreadable; the pointer is not of pointer type (second message); the operand count is outside the allowed range (old form: 3 to 5 after the operands, new form: 3 to 6); the success or failure ordering is not-atomic or unordered |
Invalid atomicrmw record | 6859, 6862, 6870, 6873, 6877, 6884, 6891 | ATOMICRMW_OLD, ATOMICRMW | The pointer is unreadable or not of pointer type (this record gives the same message for it); the value is unreadable; the operand count after the value is not 4 or 5; the operation is not a known operation; the ordering is not-atomic or unordered |
Invalid dbg record: invalid value | 6984 | DEBUG_RECORD_VALUE_SIMPLE | The value operand (operand 3, written as a value, not as metadata) is unreadable |
Invalid va_arg record | 7140, 7147 | VAARG | Fewer than 3 operands; the va_list type, the va_list value or the result type is unknown |
Invalid freeze record | 7180, 7182 | FREEZE | The operand is unreadable, or operands are left over |
Load/Store operand is not a pointer type, Cannot load/store from pointer | 5037, 5039 | LOAD, LOADATOMIC, STORE, STOREATOMIC (typeCheckLoadStoreInst) | The address is not of pointer type; the value type cannot be loaded or stored (for example void or a function type) |
Missing element type for typed attribute upgrade, Missing element type for inline asm upgrade, Missing element type for elementtype upgrade | 5055, 5086, 5122 | CALL, INVOKE, CALLBR (propagateAttributeTypes and the old-pointer upgrades) | An old typed-pointer file: a byval, sret or similar attribute, an indirect inline asm operand or an elementtype argument needs a pointee type the type table does not give |
Invalid record: operand number exceeded available operands | 5804 | CMP, CMP2 | After the two operands there is no predicate operand |
Invalid bitinsert record, Invalid bitextract record and the reason text of BitInsertInst::areInvalidOperands / BitExtractInst::areInvalidOperands | 5735, 5758 | BITINSERT, BITEXTRACT (main only) | An operand is unreadable; or the instruction class refuses the operand types (its own message is returned unchanged) |
Invalid function metadata: incoming forward references | 5143 | FUNCTION_BLOCK start | The module-level metadata still has unresolved forward references when a function block begins |
Invalid function metadata: outgoing forward refs | 7239 | FUNCTION_BLOCK end | The function’s own metadata still has unresolved forward references when its body is finished |
Never resolved function from blockaddress | 1132, 7439 | CST_CODE_BLOCKADDRESS and the end of a function block | 1132: a blockaddress names a function that is not waiting for a body (it has none); 7439: block addresses that were forward references are still unresolved when the function block ends |
Mixed debug intrinsics and debug records in bitcode module! | 7320 | after a function body | The module has used both llvm.dbg.* intrinsic calls and the DEBUG_RECORD records |
Insufficient function protos | 4076 | FUNCTION_BLOCK | There are more function blocks than function records that declare a body |
Could not find function in stream, Trying to materialize functions before seeing function blocks, Expect SubBlock, Expect function block | 4195, 4198, 4212, 4216 | finding the function blocks of a module read lazily | The stream ends where a function block should be; no function block has been seen yet; the next entry is not a sub-block; the sub-block is not a FUNCTION_BLOCK |
Malformed global initializer set | 4099 | end of the module | Global initializers or aliasees are left unresolved after the constants are read |
Sources
- llvm/lib/Bitcode/Reader/BitcodeReader.cpp – lines 782–870 (value and type operands), 5137–7259 (
parseFunctionBody) - llvm/lib/Bitcode/Writer/BitcodeWriter.cpp – lines 3261–3778, 3904–4090
- llvm/include/llvm/Bitcode/LLVMBitCodes.h – lines 553–719
- llvm/include/llvm/Bitcode/BitcodeCommon.h – the alloca flags word