From be6d0d3f180737c69248df89b0d3d24cc83f03b8 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Thu, 7 Nov 2024 10:47:31 +0100 Subject: [PATCH] removing wrong graph query in a peephole --- lang/src/son.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lang/src/son.rs b/lang/src/son.rs index 6066e55..0c9d3c3 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -1188,8 +1188,11 @@ impl Nodes { return Some(prev_store); } - if value != VOID - && self[target].inputs.len() == 4 + if let Some(&load) = + self[target].outputs.iter().find(|&&n| self[n].kind == Kind::Load) + { + self[load].peep_triggers.push(target); + } else if value != VOID && self[value].kind != Kind::Load && self[store].kind == Kind::Stre && self[store].inputs[2] == region