-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[UTC] Support to test annotated IR #165419
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
aec8313
[UTC] Support to check generated comments
Camsyn 1626db8
Regenerate the related tests
Camsyn fa39e19
Refactor to enhance readability.
Camsyn 4631c34
Make formatter happy
Camsyn b241a99
Rename option to check-inst-comments
Camsyn d890f94
Address review comments
Camsyn d9ebb7c
Regenerate tests after rebase
Camsyn 0f57f27
Add '\]' to the var regex suffix
Camsyn e293632
Regenerated the tests after adding '\]' as suffix
Camsyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here one of the labels gets a wildcard and the other doesn't. I wonder whether printing a space after the comma would give use consistent behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikic, Unfortunately, it does not work :(.
It is another reason to cause such inconsistency.

Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the wildcard is used to define
[[TMP0]]when it first appears, and the following[[TMP0]]]s just reference the first definition, just like mermaid/dot grammarThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these tests default to an old --version which doesn't use wildcards for labels. Could you try adding
--version 6to the start of the test?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have misunderstood earlier. If @nikic thinks that the
label %nopein... Edge: [label [[TMP0 :%.*]], label % nope],...is mistakenly missing a wildcard, I think I have found the cause, not a version issue or "a missed space after the comma".It's the mismatched variable regex

r"(\s*)(?:%([\w$.-]+?))([,\s\(\)\}]|\Z)"that causes such an issue:TWO approaches to fix:
Full regex:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why that specific character requirement exists, but it would probably be fine to add
\]to the list?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
597ac47 introduced such var regex suffix to help locate a var.
I think it should be safe to add ']' as another suffix, since
phi i32 [%a, %then], [%b, %else]without space is also a legal LLVM IR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikic, do you think the suffix change should be gated by a version? This suffix change might lead to a negligible impact on the current test, as such a pattern of
... %var]is rare.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need a version for this.