From f079daa42d09c278b2246034eb32420b4f634755 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Mon, 11 Nov 2024 23:33:36 +0100 Subject: [PATCH] removing redundant loop phys --- lang/src/son.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lang/src/son.rs b/lang/src/son.rs index 1d1d7bc2..756f224c 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -1043,6 +1043,10 @@ impl Nodes { K::Phi => { let &[ctrl, lhs, rhs] = self[target].inputs.as_slice() else { unreachable!() }; + if rhs == target { + return Some(lhs); + } + if lhs == rhs { return Some(lhs); }