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
Fix a couple issues with Vector128.Get/WithElement #52985
Fix a couple issues with Vector128.Get/WithElement #52985
Changes from all commits
8c2a5b1
241aa5d
765d171
d9bd42e
1a4e854
b7c8926
d11612c
539e7ae
1616c16
ff9cc27
ba55519
1b41e6f
4f08fc6
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.
I do not think it is a correct approach, this function is used during different phases, for example, during long decomposition, so calling
LowerNode
during it is incorrect.ReplaceWithLclVar
creates such IR:and lowering works node by node, so after we are done with
currentNode
we should go to the next and lower it, why don't we?See, for example,
LowerSwitch
runtime/src/coreclr/jit/lower.cpp
Line 504 in b443b8c
we call
ReplaceWithLclVar
and it creates these new nodes, but then we returnnode->gtNext
that is the created store:runtime/src/coreclr/jit/lower.cpp
Lines 785 to 791 in b443b8c
and it does their lowering.
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.
The one used in long decomposition is the instance method exposed on
LIR::Use
which is distinct from this method that is explicit to lowering and which itself calls into theLIR::Use
methodThere 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.
We should already have lowered all the previous nodes, we aren't removing the "current" node, and we aren't inserting a node after the "current" node, so the "next" node is already correct. We simply need to ensure new nodes created and inserted before this node are also lowered.
This is how the existing HWIntrinsic and SimdIntrinsics lowering has been handled and so the same technique is used here as well.
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.
Agree
Don't understand,
ReplaceWithLclVar
creates new nodes and inserts them after the "current" node, what do you mean?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.
ReplaceWithLclVar
creates new nodes and inserts them after the node it replaces. In this case, we are replacing an operand of the "current" node, which means it precedes the current node in the list and will already have been lowered.