Skip to content
Snippets Groups Projects

More rodinia optimization

Merged rarbore2 requested to merge rodinia_opt2 into main
2 files
+ 11
3
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 10
2
@@ -152,9 +152,13 @@ pub fn predication(editor: &mut FunctionEditor, typing: &Vec<TypeID>) {
@@ -152,9 +152,13 @@ pub fn predication(editor: &mut FunctionEditor, typing: &Vec<TypeID>) {
&& editor.get_constant(cons).is_false()
&& editor.get_constant(cons).is_false()
{
{
editor.edit(|mut edit| {
editor.edit(|mut edit| {
 
let inv = edit.add_node(Node::Unary {
 
op: UnaryOperator::Not,
 
input: first,
 
});
let node = edit.add_node(Node::Binary {
let node = edit.add_node(Node::Binary {
op: BinaryOperator::And,
op: BinaryOperator::And,
left: first,
left: inv,
right: third,
right: third,
});
});
edit = edit.replace_all_uses(id, node)?;
edit = edit.replace_all_uses(id, node)?;
@@ -188,9 +192,13 @@ pub fn predication(editor: &mut FunctionEditor, typing: &Vec<TypeID>) {
@@ -188,9 +192,13 @@ pub fn predication(editor: &mut FunctionEditor, typing: &Vec<TypeID>) {
&& editor.get_constant(cons).is_true()
&& editor.get_constant(cons).is_true()
{
{
editor.edit(|mut edit| {
editor.edit(|mut edit| {
 
let inv = edit.add_node(Node::Unary {
 
op: UnaryOperator::Not,
 
input: first,
 
});
let node = edit.add_node(Node::Binary {
let node = edit.add_node(Node::Binary {
op: BinaryOperator::Or,
op: BinaryOperator::Or,
left: first,
left: inv,
right: second,
right: second,
});
});
edit = edit.replace_all_uses(id, node)?;
edit = edit.replace_all_uses(id, node)?;
Loading