pub enum Op {
Show 23 variants
Binary {
op: BinaryOp,
lhs: ValueId,
rhs: ValueId,
},
Cast {
op: CastOp,
value: ValueId,
},
Compare {
predicate: u64,
lhs: ValueId,
rhs: ValueId,
},
Select {
condition: ValueId,
then: ValueId,
otherwise: ValueId,
},
ExtractValue {
aggregate: ValueId,
indices: Vec<u64>,
},
InsertValue {
aggregate: ValueId,
value: ValueId,
indices: Vec<u64>,
},
ExtractElement {
vector: ValueId,
index: ValueId,
},
InsertElement {
vector: ValueId,
value: ValueId,
index: ValueId,
},
ShuffleVector {
first: ValueId,
second: ValueId,
mask: ValueId,
},
Call {
function: ValueId,
args: Vec<ValueId>,
attributes: Option<usize>,
calling_conv: u64,
tail: TailCall,
},
Phi {
incoming: Vec<(ValueId, usize)>,
},
Return(Option<ValueId>),
Branch {
target: usize,
},
CondBranch {
condition: ValueId,
then: usize,
otherwise: usize,
},
Switch {
value: ValueId,
default: usize,
cases: Vec<(ValueId, usize)>,
},
Unreachable,
Alloca {
ty: TypeId,
size: ValueId,
align: u64,
inalloca: bool,
},
Load {
pointer: ValueId,
align: u64,
volatile: bool,
atomic: Option<Atomic>,
},
Store {
pointer: ValueId,
value: ValueId,
align: u64,
volatile: bool,
atomic: Option<Atomic>,
},
Gep {
base: ValueId,
indices: Vec<ValueId>,
source: TypeId,
inbounds: bool,
},
AtomicRmw {
pointer: ValueId,
value: ValueId,
op: u64,
volatile: bool,
atomic: Atomic,
},
CmpXchg {
pointer: ValueId,
compare: ValueId,
value: ValueId,
volatile: bool,
weak: bool,
success: Atomic,
failure: Ordering,
},
Fence(Atomic),
}Expand description
An instruction, with the value ids (absolute) and block numbers it names.
Variants§
Binary
Integer opcodes apply to integers; for floating types Add, Sub, Mul, (S)Div, (S)Rem are the float forms.
Cast
A conversion.
Fields
Compare
A comparison by its LLVM predicate (0..15 float, 32..41 integer).
Select
select: one of two values by a condition.
Fields
ExtractValue
A field or element of an aggregate.
InsertValue
An aggregate with one field or element replaced.
Fields
ExtractElement
One lane of a vector.
InsertElement
A vector with one lane replaced.
ShuffleVector
The lanes of two vectors the mask (a constant vector of lane numbers) picks.
Fields
Call
A call.
Fields
attributes: Option<usize>The attribute list of the call site (an index into Module::attribute_lists), where it names one.
Phi
The value from the predecessor block control came from: (value, block) pairs.
Return(Option<ValueId>)
ret, with the value returned where there is one.
Branch
An unconditional branch.
CondBranch
A conditional branch.
Fields
Switch
A multi-way branch: the value, the default block and the (case constant, block) pairs.
Fields
Unreachable
unreachable.
Alloca
A local variable of this type (the result is a pointer to it).
Fields
Load
A load.
Fields
Store
A store.
Fields
Gep
getelementptr: the base pointer and its indices (the first steps over the pointer itself).
Fields
AtomicRmw
atomicrmw: the operation (LLVM’s code: 0 xchg, 1 add, 2 sub, 3 and, 4 nand, 5 or, 6 xor, 7 max, 8 min, 9 umax,
10 umin); the result is the value the pointer held.
Fields
CmpXchg
cmpxchg: the result is the pair (the value the pointer held, whether it was swapped).
Fields
Fence(Atomic)
fence: ordering between invocations, which a lockstep reading does not have.