Skip to content
Snippets Groups Projects
Commit 0bcdf930 authored by Aaron Councilman's avatar Aaron Councilman
Browse files

Delete selects

parent fb0e5c58
No related branches found
No related tags found
1 merge request!57Intraprocedural SROA
Pipeline #200318 passed
......@@ -412,6 +412,7 @@ pub fn sroa(editor: &mut FunctionEditor, reverse_postorder: &Vec<NodeID>, types:
},
);
});
to_delete.push(node);
} else {
worklist.push_back(WorkItem::AllocatedTernary {
cond,
......
fn test(x : prod(i32, f32), y: prod(i32, f32), b: bool) -> prod(i32, f32)
res = select(b, x, y)
r = return(start, res)
fn test(x : prod(i32, f32), b: bool) -> prod(i32, f32)
zero = constant(u64, 0)
one = constant(i32, 1)
two = constant(u64, 2)
three = constant(f32, 3.0)
f_ctrl = fork(start, 10)
idx = thread_id(f_ctrl, 0)
mod2 = rem(idx, two)
is_even = eq(mod2, zero)
field0 = read(res, field(0))
field1 = read(res, field(1))
add = add(field0, one)
mul = mul(field1, three)
upd0 = write(res, add, field(0))
upd1 = write(res, mul, field(1))
select = select(is_even, upd0, upd1)
j_ctrl = join(f_ctrl)
res = reduce(j_ctrl, x, select)
r = return(j_ctrl, res)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment