From ae091d5319551e4c1915786c0dc52463ae6a18c9 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Thu, 1 Dec 2022 00:22:07 -0800 Subject: [PATCH] Bugfix: block start point is at start of block, not end. --- src/backend/localify.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/localify.rs b/src/backend/localify.rs index f284936..f7585fc 100644 --- a/src/backend/localify.rs +++ b/src/backend/localify.rs @@ -60,6 +60,8 @@ impl<'a> Context<'a> { let mut live: HashMap = HashMap::default(); let mut block_starts: HashMap = HashMap::default(); for &block in &self.cfg.postorder { + block_starts.insert(block, point); + self.body.blocks[block].terminator.visit_uses(|u| { self.handle_use(&mut live, &mut point, u); }); @@ -75,8 +77,6 @@ impl<'a> Context<'a> { } point += 1; - block_starts.insert(block, point); - // If there were any in-edges from blocks numbered earlier // in postorder ("loop backedges"), extend the start of // the backward-range on all live values at this point to