From 1788a42aa1e1bd442c842dec9fae955bfa6f4ba0 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Wed, 30 Nov 2022 18:19:48 -0800 Subject: [PATCH] regalloc fix: scan blocks bottom-up, not top-down! --- src/backend/localify.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/localify.rs b/src/backend/localify.rs index a9c4db4..d5e77e4 100644 --- a/src/backend/localify.rs +++ b/src/backend/localify.rs @@ -65,7 +65,7 @@ impl<'a> Context<'a> { }); point += 1; - for &inst in &self.body.blocks[block].insts { + for &inst in self.body.blocks[block].insts.iter().rev() { self.handle_inst(&mut live, &mut point, inst, /* root = */ true); point += 1; }