From 55e2f1d0eb1f3ae8b31c63e61e705e2200373c2b Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Mon, 13 May 2024 17:47:06 -0700 Subject: [PATCH] constant-blockparam: ignore inputs that are cyclic from same blockparam --- src/passes/basic_opt.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/passes/basic_opt.rs b/src/passes/basic_opt.rs index 8cad990..1ce7880 100644 --- a/src/passes/basic_opt.rs +++ b/src/passes/basic_opt.rs @@ -126,7 +126,9 @@ impl<'a> BasicOptPass<'a> { .terminator .visit_target(pos, |target| target.args[i]); let input = body.resolve_alias(input); - inputs.push(input); + if input != blockparam { + inputs.push(input); + } const_val = ConstVal::meet(const_val, Some(value_is_const(input, body))); } let const_val = const_val.unwrap();