From b09d7383ccb73b83f3f49d5fe1a590cea2913a1f Mon Sep 17 00:00:00 2001 From: esc Date: Wed, 26 Apr 2023 16:15:29 +0200 Subject: [PATCH] fix missing variable assignment Fixes #46 The problem was that, in case of a multi-header loop with a single exit, the control-variable wasn't being setup correctly. A further problem is that, even though this was tested, only the overall block structure of the SCFG was being compared. However the instructions of the blocks themselves were not, so this went unnoticed. The fix for the test is to add the instructions contained within blocks to the YAML and then we can test this properly. --- numba_rvsdg/core/transformations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numba_rvsdg/core/transformations.py b/numba_rvsdg/core/transformations.py index 65b0ffb..812024d 100644 --- a/numba_rvsdg/core/transformations.py +++ b/numba_rvsdg/core/transformations.py @@ -169,7 +169,7 @@ def reverse_lookup(d, value): variable_assignment[backedge_variable] = reverse_lookup( backedge_value_table, loop_head ) - if needs_synth_exit: + if needs_synth_exit or headers_were_unified: variable_assignment[exit_variable] = reverse_lookup( header_value_table, jt )