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

asm: implicit label after return or abort terminator #718

Closed
wants to merge 2 commits into from

Conversation

msiglreith
Copy link
Contributor

Implicitly add an OpLabel once a return or abort terminator is found in the asm line stream. This allows to remove the %unused = OpLabel workaround.

Internally, it creates an explicit label instruction and skips the begin_block/end_block mechanism of the rspirv builder due to how the cursor works. I hope handling this transparently is fine, asumming there will be no reference to this label.

Depends on #717
Fixes #564

OpUnreachable will be appended as terminator at the end of the asm block.
Copy link
Contributor

@khyperia khyperia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect, as the user should be able to write multiple blocks in an asm! with normal syntax - with this, they would somehow have to know to not write OpLabel.

Also, please merge this PR into #717, partial fixes from partial PRs leaving glaring issues are very difficult to coordinate and review. (I didn't see this PR when I reviewed 717)

@msiglreith
Copy link
Contributor Author

Thanks, will look into it again - closing in favor of a single PR #717

@msiglreith msiglreith closed this Aug 11, 2021
@msiglreith msiglreith deleted the asm-terminator branch August 26, 2021 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correctly handle terminators in inline assembly
2 participants