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.
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
SESE canonicalization: unroll loop to eliminate undefs. #19811
SESE canonicalization: unroll loop to eliminate undefs. #19811
Changes from 5 commits
b1a5479
cca2adf
12b8668
778972f
e1c5f1a
3f7e4e1
4e534df
9b6e361
472ee0d
83a9d73
b111c5b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
should we find better names for the param names? like oldValue -> key, newValue -> value
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 oldValue and newValue are better. It just says that when we are cloning replace occurrences of oldValue with new Value. Updated the function comment.
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.
consider renaming to unrollLoopBodyOnce(), and remove the comment.
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.
Done.
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.
nit: argument's -> arguments?
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.
Done.
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.
given "newHeader", it'd be less confusing if we change this to "oldHeader", and same for clonedHeader.
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.
Changed to clonedOldHeader.
header
is a class field.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.
mentioning
pred
here makes the comment block hard to read and confusing, as that name does not appear in the large block of CFG example below (I was initially wondering if there's a typo), but seems to instead refer to a var in the code that's many lines down below.consider first explaining the rationale/benefit/mechanics (the why and what) of unrolling in terms of the example below. we can then add another comment block right above the code below, to describe how that is in general implemented in terms of variables in the code, so that the code-related comment would echo / reiterate on what the example has illustrated for the readers.
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 able to follow this example overall. the entire textual representation is hard to read. for example, where is stayInLoop updated?
it might help if:
Also, to make things simpler, is it possible to avoid generating undefs in the first place, vs first generating it, and then try eliminating it? specifically, can we achieve that by moving loop rotation earlier?
newLatch(i4, i5)
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.
what if we cannot find such a value? should we assert this won't ever happen?
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.
It is guaranteed to find a value. SIL verification will fail otherwise. No need to add another check that will essentially replicate SIL verification.
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.
Debugging SIL verifier failure usually takes more work because the context is non-local. It'd usually be preferrable to have a local check so that we can fail fast. Also, the check serves as a documentation for this important invariant.
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.
Good point. Added an assert to check that we patch such arguments.