-
Notifications
You must be signed in to change notification settings - Fork 80
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
core: Fix check for forward refs by checking for ssa refs instead of block refs #3851
Changes from 1 commit
e44cd87
b86c47e
0bc2616
324792f
83ee4c0
60fd998
9eceb8c
a216535
41b16cd
75fbbe0
617303c
51db69f
4504a60
6e51e9b
9f50033
34ab330
4088e1b
64b9606
2291eb9
b356946
7650810
9cf7ddb
efd244e
dc78d82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,7 +145,7 @@ def parse_module(self, allow_implicit_module: bool = True) -> ModuleOp: | |
value_names = ", ".join( | ||
"%" + name for name in self.forward_ssa_references.keys() | ||
) | ||
if len(self.forward_block_references.keys()) > 1: | ||
if len(self.forward_ssa_references.keys()) > 1: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is purely for getting the plural correct it seems There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok thanks @alexarice, I updated the description There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this just to purely have a plural and singular form in the error? I don't remember the initial discussion, but wouldn't something like:
work for both cases? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel this what we do in most places. I was surprised that it tries to get the plural correct here (yet gets it wrong anyway) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH yeah it seems like a reasonable simplifying change. Maybe even something like this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. easier to grep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @emmau678 let's update to do something like this? maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry had not seen this last comment
emmau678 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
self.raise_error(f"values {value_names} were used but not defined") | ||
else: | ||
self.raise_error(f"value {value_names} was used but not defined") | ||
|
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.
Can the check statement go before the code? I'm also not sure the comment is necessary, the error message describes what is going on.
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.
moved it, thanks
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.
Unless github is being weird, it seems you moved a different one?
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 think the comment can stay since we are doing it for the rest of the file.
I have a different question though; how does this differ from the test case directly above?
(maybe I need more coffee?)
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 think they are similar except the first one only reports one value, so it's coming from a different if branch in core.py