From 1b8bb98df41cc4fc1a59d89fa72b3ecde23feafe Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Sat, 26 Sep 2026 15:46:05 -0700 Subject: [PATCH] resolve_aliases: resolve every terminator use, not only branch args. Terminators may hvae other uses as well (e.g., conditional branch inputs). The prior version's omission of these uses during alias-rewriting does not impact correctness, but it does mean that some optimizations don't hit as often as they should. --- src/passes/resolve_aliases.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/passes/resolve_aliases.rs b/src/passes/resolve_aliases.rs index bf46570..8457617 100644 --- a/src/passes/resolve_aliases.rs +++ b/src/passes/resolve_aliases.rs @@ -29,10 +29,8 @@ pub fn run(body: &mut FunctionBody) { } let mut blocks = std::mem::take(&mut body.blocks); for block in blocks.values_mut() { - block.terminator.update_targets(|target| { - for arg in &mut target.args { - *arg = body.resolve_alias(*arg); - } + block.terminator.update_uses(|u| { + *u = body.resolve_alias(*u); }); } body.blocks = blocks;