Skip to content

Add support for storing basic block context in Gematria formats. #288

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

Open
wants to merge 3 commits into
base: experiment/preceding-following-context
Choose a base branch
from

Conversation

virajbshah
Copy link
Collaborator

  • Add fields to the proto specification to store context.
  • Add members to the Gematria BasicBlock data structure to store context and update methods on it and its Python binding accordingly.
  • Bonus: Remove dangling TODO.

 * Add fields to the `proto` specification to store context.
 * Add members to the Gematria `BasicBlock` data structure to store
   context and update methods on it and its Python binding accordingly.
 * Bonus: Remove dangling TODO.
@virajbshah
Copy link
Collaborator Author

Bumping the C++ formatting CI version from v4.11.0 (clang-format-16) -> v4.14.0 (clang-format-19) should be enough to fix that failing check, though I'm not sure if re-running it after the update will use the new version without adding another commit to this PR.

boomanaiden154 added a commit to boomanaiden154/gematria that referenced this pull request Jan 29, 2025
This patch bumps the clang-format that we are using to v19 to fix some
issues that came up in google#288.
boomanaiden154 added a commit to boomanaiden154/gematria that referenced this pull request Jan 29, 2025
This patch bumps the clang-format that we are using to v19 to fix some
issues that came up in google#288.
@boomanaiden154
Copy link
Collaborator

though I'm not sure if re-running it after the update will use the new version without adding another commit to this PR.

#291. If you rerun the checks, it will be fixed. Github tests PRs as if they are merged against main by default.

Copy link
Collaborator

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

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

Some initial comments.

boomanaiden154 added a commit that referenced this pull request Jan 29, 2025
This patch bumps the clang-format that we are using to v19 to fix some
issues that came up in #288.
@virajbshah
Copy link
Collaborator Author

If you rerun the checks, it will be fixed. Github tests PRs as if they are merged against main by default.

That would make sense, but for whatever reason re-running the action still uses clang-format-18. IIRC, adding another commit to the PR is what gets GitHub to pick up on the updated workflows.

@boomanaiden154
Copy link
Collaborator

That would make sense, but for whatever reason re-running the action still uses clang-format-18. IIRC, adding another commit to the PR is what gets GitHub to pick up on the updated workflows.

Interesting. Running git merge main on your branch after pulling a recent main should definitely fix the issue.

Copy link
Collaborator

@ondrasej ondrasej left a comment

Choose a reason for hiding this comment

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

Overall, this looks good. I'll approve once the comments are all resolved.

 * Change `back_context` -> `preceding_context` and
  `front_context` -> `following_context`.
 * Add test for updated `BasicBlock::ToString`.
 * Keep previous proto field numbering.
@virajbshah virajbshah requested a review from ondrasej February 8, 2025 19:46
@virajbshah virajbshah changed the base branch from main to experiment/preceding-following-context June 9, 2025 13:32
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.

3 participants