pub enum LlvmInstr {
Show 39 variants
Alloca {
result: String,
ty: LlvmType,
align: Option<u32>,
},
Load {
result: String,
ty: LlvmType,
ptr: LlvmValue,
align: Option<u32>,
},
Store {
val: LlvmValue,
ty: LlvmType,
ptr: LlvmValue,
align: Option<u32>,
},
Add {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
Sub {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
Mul {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
SDiv {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
SRem {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
FAdd {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
FSub {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
FMul {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
FDiv {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
And {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
Or {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
Xor {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
Shl {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
LShr {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
AShr {
result: String,
lhs: LlvmValue,
rhs: LlvmValue,
},
ICmp {
result: String,
pred: IcmpPred,
lhs: LlvmValue,
rhs: LlvmValue,
},
FCmp {
result: String,
pred: FcmpPred,
lhs: LlvmValue,
rhs: LlvmValue,
},
Br(String),
CondBr {
cond: LlvmValue,
true_: String,
false_: String,
},
Ret(Option<(LlvmType, LlvmValue)>),
Unreachable,
Label(String),
Call {
result: Option<String>,
ret_ty: LlvmType,
func: String,
args: Vec<(LlvmType, LlvmValue)>,
},
GetElementPtr {
result: String,
base_ty: LlvmType,
ptr: LlvmValue,
indices: Vec<(LlvmType, LlvmValue)>,
},
BitCast {
result: String,
val: LlvmValue,
from_ty: LlvmType,
to_ty: LlvmType,
},
Phi {
result: String,
ty: LlvmType,
incoming: Vec<(LlvmValue, String)>,
},
Select {
result: String,
cond: LlvmValue,
true_val: LlvmValue,
false_val: LlvmValue,
ty: LlvmType,
},
ExtractValue {
result: String,
agg: LlvmValue,
agg_ty: LlvmType,
indices: Vec<u32>,
},
InsertValue {
result: String,
agg: LlvmValue,
agg_ty: LlvmType,
val: LlvmValue,
val_ty: LlvmType,
indices: Vec<u32>,
},
ZExt {
result: String,
val: LlvmValue,
from_ty: LlvmType,
to_ty: LlvmType,
},
SExt {
result: String,
val: LlvmValue,
from_ty: LlvmType,
to_ty: LlvmType,
},
Trunc {
result: String,
val: LlvmValue,
from_ty: LlvmType,
to_ty: LlvmType,
},
FpToSI {
result: String,
val: LlvmValue,
from_ty: LlvmType,
to_ty: LlvmType,
},
SIToFp {
result: String,
val: LlvmValue,
from_ty: LlvmType,
to_ty: LlvmType,
},
FpExt {
result: String,
val: LlvmValue,
from_ty: LlvmType,
to_ty: LlvmType,
},
FpTrunc {
result: String,
val: LlvmValue,
from_ty: LlvmType,
to_ty: LlvmType,
},
}Expand description
LLVM IR instruction.
Variants§
Alloca
%result = alloca ty [, align N]
Load
%result = load ty, ptr %ptr [, align N]
Store
store ty %val, ptr %ptr [, align N]
Add
%result = add i64 %lhs, %rhs
Sub
%result = sub i64 %lhs, %rhs
Mul
%result = mul i64 %lhs, %rhs
SDiv
%result = sdiv i64 %lhs, %rhs
SRem
%result = srem i64 %lhs, %rhs
FAdd
%result = fadd double %lhs, %rhs
FSub
%result = fsub double %lhs, %rhs
FMul
%result = fmul double %lhs, %rhs
FDiv
%result = fdiv double %lhs, %rhs
And
%result = and i64 %lhs, %rhs
Or
%result = or i64 %lhs, %rhs
Xor
%result = xor i64 %lhs, %rhs
Shl
%result = shl i64 %lhs, %rhs
LShr
%result = lshr i64 %lhs, %rhs
AShr
%result = ashr i64 %lhs, %rhs
ICmp
%result = icmp pred i64 %lhs, %rhs
FCmp
%result = fcmp pred double %lhs, %rhs
Br(String)
br label %target
CondBr
br i1 %cond, label %true_, label %false_
Ret(Option<(LlvmType, LlvmValue)>)
ret void or ret ty val
Unreachable
unreachable
Label(String)
A basic block label: name:
Call
[%result = ] call ret_ty @func(args...)
GetElementPtr
%result = getelementptr inbounds base_ty, ptr %ptr, indices...
BitCast
%result = bitcast from_ty %val to to_ty
Phi
%result = phi ty [ %val1, %bb1 ], [ %val2, %bb2 ]
Select
%result = select i1 %cond, ty %true_val, ty %false_val
ExtractValue
%result = extractvalue agg_ty %agg, indices...
InsertValue
%result = insertvalue agg_ty %agg, val_ty %val, indices...
Fields
ZExt
%result = zext from_ty %val to to_ty
SExt
%result = sext from_ty %val to to_ty
Trunc
%result = trunc from_ty %val to to_ty
FpToSI
%result = fptosi from_ty %val to to_ty
SIToFp
%result = sitofp from_ty %val to to_ty
FpExt
%result = fpext from_ty %val to to_ty
FpTrunc
%result = fptrunc from_ty %val to to_ty