From 7058efe75c7ad245db80986e77a97d426b9be8a4 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Fri, 15 Nov 2024 19:32:04 +0100 Subject: [PATCH] reverting phi transformation --- lang/src/son.rs | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/lang/src/son.rs b/lang/src/son.rs index 0bc4cd0..431d346 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -1083,16 +1083,30 @@ impl Nodes { return Some(self.new_node(self[lhs].ty, Kind::Stre, vc, tys)); } - if let Kind::BinOp { op } = self[lhs].kind - && self[rhs].kind == (Kind::BinOp { op }) - { - debug_assert!(ty != ty::Id::VOID); - let inps = [ctrl, self[lhs].inputs[1], self[rhs].inputs[1]]; - let nlhs = self.new_node(ty, Kind::Phi, inps, tys); - let inps = [ctrl, self[lhs].inputs[2], self[rhs].inputs[2]]; - let nrhs = self.new_node(ty, Kind::Phi, inps, tys); - return Some(self.new_node(ty, Kind::BinOp { op }, [VOID, nlhs, nrhs], tys)); - } + //if let Kind::BinOp { op } = self[lhs].kind + // && self[rhs].kind == (Kind::BinOp { op }) + //{ + // debug_assert!(ty != ty::Id::VOID); + // debug_assert_eq!( + // self[lhs].ty.simple_size(), + // ty.simple_size(), + // "{:?} {:?}", + // self[lhs].ty.expand(), + // ty.expand() + // ); + // debug_assert_eq!( + // self[rhs].ty.simple_size(), + // ty.simple_size(), + // "{:?} {:?}", + // self[rhs].ty.expand(), + // ty.expand() + // ); + // let inps = [ctrl, self[lhs].inputs[1], self[rhs].inputs[1]]; + // let nlhs = self.new_node(ty, Kind::Phi, inps, tys); + // let inps = [ctrl, self[lhs].inputs[2], self[rhs].inputs[2]]; + // let nrhs = self.new_node(ty, Kind::Phi, inps, tys); + // return Some(self.new_node(ty, Kind::BinOp { op }, [VOID, nlhs, nrhs], tys)); + //} } K::Stck => { if let &[mut a, mut b] = self[target].outputs.as_slice() {