-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect restructuring of multi-head loop #46
Comments
Same problem in |
This graph variation is already present in the the test suite: https://github.com/numba/numba-rvsdg/blob/main/numba_rvsdg/tests/test_transforms.py#L552 The input looks like: And the output like: We can see here, that the variable It does work correctly in this case. So my next guess is that this may be related to the loop having only a single exit. The reason this was not caught by the testing suite, is because the YAML tests only compare the structure of the graph, but not the "contents" of each block. Additional work on the testing suite will be needed to allow for encoding this. |
I have created a patch to fix this issue, it was indeed the case, when there were two headers but only one exit:
And the correct rendering looks like: The blocks |
Fixes numba#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.
Fixes numba#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.
From
DEBUGGRAPH=1 pytest numba_rvsdg/tests/test_mock_asm.py::test_mock_scfg_fuzzer_case9
in #42.CFG:
Loop restructured:
The loop should switch between offset 4 and offset 6 blocks but there are no assignment to control-variable a within the loop.
The text was updated successfully, but these errors were encountered: