Skip to content

Commit

Permalink
add select to brillvm
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpal committed May 10, 2024
1 parent bcc9d44 commit 63eb329
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions bril-rs/brillvm/src/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,34 @@ fn build_instruction<'a, 'b>(
op: ValueOps::Id,
op_type: _,
} => build_op(context, builder, heap, fresh, |v| v[0], args, dest),

Instruction::Value {
args,
dest,
funcs: _,
labels: _,
op: ValueOps::Select,
op_type: _
} => {
let ret_name = fresh.fresh_var();
build_op(
context,
builder,
heap,
fresh,
|v| {
builder.build_select::<BasicValueEnum, IntValue>(
v[0].try_into().unwrap(),
v[1].try_into().unwrap(),
v[2].try_into().unwrap(),
&ret_name
).into()
},
args,
dest
)
}

Instruction::Value {
args,
dest,
Expand Down

0 comments on commit 63eb329

Please sign in to comment.