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

Merge branch 'main' into sroa

parents 0bcdf930 82edc984
No related branches found
No related tags found
1 merge request!57Intraprocedural SROA
Pipeline #200322 passed
...@@ -688,26 +688,19 @@ fn typeflow( ...@@ -688,26 +688,19 @@ fn typeflow(
return Error(String::from("Ternary node must have exactly three inputs.")); return Error(String::from("Ternary node must have exactly three inputs."));
} }
if let Concrete(id) = inputs[0] { match op {
match op { TernaryOperator::Select => {
TernaryOperator::Select => { if let Concrete(id) = inputs[0] {
if !types[id.idx()].is_bool() { if !types[id.idx()].is_bool() {
return Error(String::from( return Error(String::from(
"Select ternary node input cannot have non-bool condition input.", "Select ternary node input cannot have non-bool condition input.",
)); ));
} }
let data_ty = TypeSemilattice::meet(inputs[1], inputs[2]);
if let Concrete(data_id) = data_ty {
return Concrete(data_id);
} else {
return data_ty;
}
} }
TypeSemilattice::meet(inputs[1], inputs[2])
} }
} }
Error(String::from("Unhandled ternary types."))
} }
Node::Call { Node::Call {
control: _, control: _,
......
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