diff --git a/src/rvsdg/snapshots/eggcc__rvsdg__tests__rvsdg_unstructured.snap b/src/rvsdg/snapshots/eggcc__rvsdg__tests__rvsdg_unstructured.snap new file mode 100644 index 000000000..07dc8aa3b --- /dev/null +++ b/src/rvsdg/snapshots/eggcc__rvsdg__tests__rvsdg_unstructured.snap @@ -0,0 +1,1634 @@ +--- +source: src/rvsdg/tests.rs +expression: rvsdg.to_svg() +--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 4 + + + + + + + + + + + lt + + + + + + + + + + + + + + match + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + loop + + + + + + + + + + + + + + + + + + + + + + + + + + + + match + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + lt + + + + + + + + + + + + + + + add + + + + + + + + + + + + + + match + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/rvsdg/tests.rs b/src/rvsdg/tests.rs index 839a5de19..20dc9be23 100644 --- a/src/rvsdg/tests.rs +++ b/src/rvsdg/tests.rs @@ -288,7 +288,7 @@ fn rvsdg_unstructured() { // meaningful, but we know it should have the following properties: // // 1. A theta node: .B and .C form a cycle. - // 2. A gamma node, as there is a join point in .B for the value of `x` + // 2. An if node, as there is a join point in .B for the value of `x` // (whether the predecessor is .B or the entry block). assert!(rvsdg.results.len() == 2); // return value + state edge assert!(search_for(rvsdg, |body| matches!( @@ -297,7 +297,7 @@ fn rvsdg_unstructured() { ))); assert!(search_for(rvsdg, |body| matches!( body, - RvsdgBody::Gamma { .. } + RvsdgBody::If { .. } ))) } diff --git a/src/rvsdg/to_cfg.rs b/src/rvsdg/to_cfg.rs index 349551b8a..1fb032689 100644 --- a/src/rvsdg/to_cfg.rs +++ b/src/rvsdg/to_cfg.rs @@ -393,7 +393,7 @@ impl<'a> RvsdgToCfg<'a> { let switch = RvsdgBody::Gamma { pred: *pred, inputs: inputs.clone(), - outputs: vec![then_branch.clone(), else_branch.clone()], + outputs: vec![else_branch.clone(), then_branch.clone()], }; // Desugar to a switch with a boolean predicate, // then translate the switch