Closed esc closed 1 year ago
Could you please rebase this onto the current
main
. Thanks.
done
It looks like the test is failing post-rebase, I'll have to debug this.
OK, so here is the failing graph comparison, it seems like the graph is partially mirrored at the basic_block_1
-- the order of the jump targets seems reversed.
It looks like with the merge of the remove_labels
PR, the test harness has become stricter and exposed that this test had been working by accident. 08b019eaac56f0c0597af69f38603c680a6897d2 fixes -- basically on input we have [1, 2]
and the link to 1
is replaced with a link to 5 -- so the expected jump_targets should be [5, 2]
-- the commit fixes that!
The changes LGTM! I think we can go ahead with the merge on this one.
@kc611 thank you for the review!
Fixes #45
Headers of multi-block loops that have a backedge to themselves, didn't have this processed.
The case of:
label not in doms[jt]
accounts for the case, where there were multiple entry edges into the loop and the original header has been replaced with a synthetic one.
An alternative fix would have been to simply delete this check, but then this breaks the test case
test_double_header
(after hacking the followup issues). This fix is non-intrusive and a test for the edge cases has been added too.