-
Notifications
You must be signed in to change notification settings - Fork 5.3k
No const arg to temp #48308
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
No const arg to temp #48308
Conversation
sandreenko
left a 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.
Could you please look at few regressions and see what is causing them?
In order to do this I usually build Core_Root_base, Core_Root_diff and then set COMPlus_NgenDump to the method that I need to get the diffs using different set CORE_ROOT.
The full command in my case would be:
set Core_Root= D:\Sergey\git\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root_diff
set Complus_NgenDump=methodName
D:\Sergey\git\runtime\artifacts\bin\coreclr\windows.x64.Checked\crossgen.exe /Platform_Assemblies_Paths "D:\Sergey\git\runtime\artifacts\bin\coreclr\windows.x64.Checked\IL" /out "D:\Sergey\git\runtime\artifacts\bin\coreclr\windows.x64.Checked\System.Private.CoreLib.dll" "D:\Sergey\git\runtime\artifacts\bin\coreclr\windows.x64.Checked\IL\System.Private.CoreLib.dll">D:\Sergey\logs\temp\diff.txt
the same for base.
and then compare diff/base in meld/notepad++
src/coreclr/jit/compiler.cpp
Outdated
| } | ||
|
|
||
| BOOL Compiler::IsInvariant(GenTree* tree) | ||
| { |
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.
Do we need this function or GenTree::IsInvariant can be left alone and this one deleted?
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 GenTree::IsInvariant wraps a call to this function. I could consolidate it all into one or the other if you think that would be better, I just couldn't get the call to Compiler::IsInvariant to work from within gentree.h.
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 have tried it in sandreenko@de99bfd it works well, what issue do you see? Can you cherry-pick this change?
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.
Sure, I don't see any obvious issues. I'll cherry-pick the commit, double check the diffs locally, and push the updated branch if no issues come up in the diffs.
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.
No major change in the diff, pushed the updated branch. Thanks for the help!
src/coreclr/jit/compiler.cpp
Outdated
| optMethodFlags |= OMF_HAS_NULLCHECK; | ||
| } | ||
|
|
||
| BOOL Compiler::IsInvariant(GenTree* tree) |
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.
you can change impIsAddressInLocal to (const GenTree* tree, GenTree** lclVarTreeOut) and declare tree const here as well, so you don't need to cast const away in bool GenTree::IsInvariant() const
| { | ||
| // This can be extended to non-constant nodes, but not to local or indir nodes. | ||
| if (OperIsConst() && ((gtFlags & GTF_REUSE_REG_VAL) != 0)) | ||
| if (IsInvariant() && ((gtFlags & GTF_REUSE_REG_VAL) != 0)) |
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.
looks like it did not get any diffs, it was Total bytes of delta: -2397 (-0.01% of base) before this and after, I wonder if something else is blocking it.
Co-authored-by: Sergey Andreenko <[email protected]>
Co-authored-by: Sergey Andreenko <[email protected]>
Co-authored-by: Sergey Andreenko <[email protected]>
Sure, I'll check it and update with more details. |
|
/azp run runtime-coreclr jitstress |
|
PTAL @AndyAyersMS @dotnet/jit-contrib |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@sandreenko Still looking into the regressions. Merged this branch with master and my updated my local master branch this morning just to make sure everything was up-to-date and re-ran the diffs, I think my first set of numbers may have had a stale build. Here's the new set of diffs: |
|
@sandreenko Having a little trouble narrowing down where the regression is. I've been using the command: LogsTo generate the files to compare. When I do a diff of the two files, I'm only seeing differences in addresses, but no real difference in what is being generated. For example, if I look at the code that is generated for
The only difference I'm seeing are addresses used ( Please let me know if you have any advice on what to change to get a better sense of where the regression might be. |
|
@alexcovington Note: I have edited your comment to hide the logs under a spoiler, I recommend attaching them as text files in general or it makes it long to scroll between comments 😄 I usually create 2 copies of Core_Root for copies and my command looks like: and it shows the expected diffs: Looks like your changes discovered another issue, opened #48451 for it. It should fix the regressions that are real, the rest look like noise (like LSRA allocates different regs or frame size became smaller and now we can't init it with only SIMD instructions and have to emit some movs). |
|
Thanks for the feedback @sandreenko, I didn't know the spoiler feature existed! Very nice.
Sounds good, I'll take another look over just to be sure. Otherwise, let me know if I can add/do anything else for this PR. Only difference I have found so far is the frame size for BaseDiff |
sandreenko
left a 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.
LGTM, thanks @alexcovington.
@AndyAyersMS could you please take a look as well?
AndyAyersMS
left a 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.
LGTM.
Thanks!
PR to address #47786. Adds
Compiler::IsInvariantandGenTree::IsInvariantfunctions to check if op is an invariant, changes a few checks to use this function instead of only usingOperIsConst.Here are the library diffs:
Please let me know if I can add/expand on anything above.