-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Optimize FMA codegen base on the overwritten #58196
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 1 commit
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
ee2c0b6
Optimize FMA codegen base on the overwritten
weilinwa 46d0011
Improve function/var names
weilinwa cce4bda
Add assertions
weilinwa b825291
Get use of FMA with TryGetUse
weilinwa f615e39
Decide FMA form with two conditions, OverwrittenOpNum and isContained
weilinwa b698036
Fix op reg error in codegen
weilinwa 7d9c0d6
Decide form using lastUse and isContained in no overwritten case
weilinwa 1344d92
Clean up code
weilinwa 029a9b5
Separate default case overwrittenOpNum==0
weilinwa f2a371f
Apply format patch
weilinwa 9955389
Change variable and function names
weilinwa 7c56653
Update regOptional for op1 and resolve some other comments
weilinwa 1d51caa
Optimize FMA codegen base on the overwritten
weilinwa 091133e
Improve function/var names
weilinwa 9a6ae44
Add assertions
weilinwa ffcff76
Get use of FMA with TryGetUse
weilinwa 5641f8f
Decide FMA form with two conditions, OverwrittenOpNum and isContained
weilinwa b7312ac
Fix op reg error in codegen
weilinwa a325fe3
Decide form using lastUse and isContained in no overwritten case
weilinwa 0f950dd
Clean up code
weilinwa 33a596d
Separate default case overwrittenOpNum==0
weilinwa 5da9368
Apply format patch
weilinwa c3a9f07
Change variable and function names
weilinwa 9e356aa
Update regOptional for op1 and resolve some other comments
weilinwa f8159bc
Change var names
weilinwa 18bbe4d
Resolve merge conflicts.
weilinwa 2ca2524
Fix jit format
weilinwa 17bd967
Fix build node error for op1 is regOptional
weilinwa eed5912
Use targetReg instead of GetResultOpNumForFMA in codegen
weilinwa 43c5034
Update variable names
weilinwa 5ef70a5
Refactor lsra to solve lastUse status changed caused assertion failure
weilinwa bfa6924
Add check to prioritize contained op in lsra
weilinwa 12f260b
Update for jit format
weilinwa 5ca658e
Simplify code
weilinwa ec4ef66
Resolve comments
weilinwa aa93a85
Comment out assert because of lastUse change
weilinwa c66a018
Fix some copiesUpperBits related errors
weilinwa ff5a433
Merge branch 'main' into fma_opt
weilinwa a4657c7
Update src/coreclr/jit/lsraxarch.cpp
weilinwa 75d7a37
Add link to the new issue
weilinwa 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
Comment out assert because of lastUse change
- Loading branch information
commit aa93a853b354e47e63eddbf8cb46dc2049d8b0b1
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2363,7 +2363,8 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) | |
|
|
||
| if (containedOpNum == 1) | ||
| { | ||
| assert(containedOpNum != resultOpNum); | ||
| // resultOpNum might change between lowering and lsra, comment out assertion for now. | ||
| // assert(containedOpNum != resultOpNum); | ||
| // resultOpNum is 3 or 0: op3/? = ([op1] * op2) + op3 | ||
| std::swap(emitOp1, emitOp3); | ||
|
|
||
|
|
@@ -2375,7 +2376,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) | |
| } | ||
| else if (containedOpNum == 3) | ||
| { | ||
| assert(containedOpNum != resultOpNum); | ||
| // assert(containedOpNum != resultOpNum); | ||
|
Contributor
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. same here? |
||
| if (resultOpNum == 2 && !copiesUpperBits) | ||
| { | ||
| // op2 = (op1 * op2) + [op3] | ||
|
|
@@ -2385,7 +2386,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) | |
| } | ||
| else if (containedOpNum == 2) | ||
| { | ||
| assert(containedOpNum != resultOpNum); | ||
| // assert(containedOpNum != resultOpNum); | ||
|
|
||
| // op1/? = (op1 * [op2]) + op3 | ||
| std::swap(emitOp2, emitOp3); | ||
|
|
||
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.
Need to uncomment this assert?
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.
This assertion cannot be uncommented because the last use value could change after lowering step. I left them here for follow up work if necessary.
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.
Could you please create a issue for it and add the link to the issue in the comment here?