-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nesting FlowControllers to allow nested conditionals in pass manager (#…
…6962) * added reno * changes * added suggested changes * format * fixed raise * added tests * added tests for nested do_while * Test edit * Fix nested conditional test This was meant to test a conditional within a while loop. Before this commit, the condition being tested never changed during the while loop. With this commit, the value checked by the conditional is different for different iterations. And this test confirms that the conditional pass runs when it is supposed to and does not run when it is not supposed to. * Remove two tests that don't test this PR Two tests were included in this PR whose behavior would be unaffected by the code changes in this PR. So they don't belong in this PR. I am removing them with this commit. modified: test_pass_scheduler.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
25e1d20
commit b66030e
Showing
4 changed files
with
98 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/add-nested-conditionals-pass-manager-db7b8b9874018d0d.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
features: | ||
- | | ||
Allows adding nested FlowControllers (like ConditionalController) to PassManagers when adding passes in the append function. | ||
example:: | ||
flow_unroll = [ConditionalController(_unroll, condition=_unroll_condition)] | ||
pm.append(_depth_check + _opt + _unroll_check + flow_unroll, do_while=_opt_control) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters