Skip to content
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

BasicBlock exit nodes should not be OpTag::DataflowParents #1408

Closed
aborgna-q opened this issue Aug 8, 2024 · 0 comments · Fixed by #1409
Closed

BasicBlock exit nodes should not be OpTag::DataflowParents #1408

aborgna-q opened this issue Aug 8, 2024 · 0 comments · Fixed by #1409
Assignees
Labels
bug Something isn't working

Comments

@aborgna-q
Copy link
Collaborator

This is causing a panic in the force_order pass

@aborgna-q aborgna-q added the bug Something isn't working label Aug 8, 2024
@aborgna-q aborgna-q self-assigned this Aug 8, 2024
github-merge-queue bot pushed a commit that referenced this issue Aug 9, 2024
The optags for basic blocks where defined as
```mermaid
graph TD
  classDef transparent fill:#0000,stroke:#0000
  a[...]:::transparent-->DataflowParent
  b[...]:::transparent-->ControlFlowChild
  DataflowParent --> BasicBlock
  ControlFlowChild --> BasicBlock
  BasicBlock --> BasicBlockExit
```
notice that `BasicBlockExit` was a descendant from `DataflowParent`.
This caused errors on code that checked for the tag, such as the
[`force_order`
pass](https://github.com/CQCL/hugr/blob/e485a23e0cb73b0070e5d6f3374f6de16f545d04/hugr-passes/src/force_order.rs#L58-L59).

This PR changes the hierarchy to
```mermaid
graph TD
  classDef transparent fill:#0000,stroke:#0000
  a[...]:::transparent-->DataflowParent
  b[...]:::transparent-->ControlFlowChild
  DataflowParent --> DataflowBlock
  ControlFlowChild --> BasicBlockExit
  ControlFlowChild --> DataflowBlock
```

Closes #1408 

BREAKING CHANGE: Removed `OpTag::BasicBlock`, replaced with
`OpTag::DataflowBlock` and `OpTag::ControlFlowChild`

---------

Co-authored-by: Seyon Sivarajah <seyon.sivarajah@quantinuum.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant