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

[CIR][IR] Refactor parsing/printing of implicitly terminated regions #310

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

sitio-couto
Copy link
Collaborator

@sitio-couto sitio-couto commented Nov 15, 2023

Stack from ghstack (oldest at bottom):

The shouldPrintTerm and checkBlockTerminator were replaced in favor
of omitRegionTerm and ensureRegionTerm respectively. The first is
essentially the same method but simplified. The latter was refactored to
do only two things: check if the terminator omission of a region is
valid and, if so, insert the omitted terminator into the region.

The simplifications mostly leverage the fact that we only omit empty
yield values in a single-block region.

The `shouldPrintTerm` and `checkBlockTerminator` were replaced in favor
of `omitRegionTerm` and `ensureRegionTerm` respectively. The first is
essentially the same method but simplified. The latter was refactored to
do only two things: check if the terminator omission of a region is
valid and, if so, insert the omitted terminator into the region.

The simplifications mostly leverage the fact that we only omit empty
yield values in a single-block region.

[ghstack-poisoned]
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Great cleanup, thanks!

@sitio-couto
Copy link
Collaborator Author

sitio-couto commented Nov 17, 2023

Recreated in #321 to fix a ghstack issue

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.

2 participants