Do not fast tail call if caller has multislot structs#25885
Do not fast tail call if caller has multislot structs#25885jashook merged 5 commits intodotnet:masterfrom
Conversation
|
Note this effects unix x64 only. |
|
/cc @RussKeldorph Note I discovered that this change should be in #20643 and originally added it there. Then realized this is most likely a bug going back. So this change has been tested already. It is just waiting on reviews. Will hoist it out of #20643. |
|
Fixes #25884 |
|
/cc @dotnet/jit-contrib |
AndyAyersMS
left a comment
There was a problem hiding this comment.
Do we see any diffs from this?
|
I would argue that this change does not need to run diffs. That being said, this should be a very quick run and a very easy zero diff example. Will report back. |
Running diffs should be cheap enough now that we should always do it as a matter of practice. I am curious about a few things:
|
CarolEidt
left a comment
There was a problem hiding this comment.
LGTM with a couple of comment changes (mentioned offline)
|
@AndyAyersMS there are diffs with this PR, they effect the SIMD tests. Unfortunately superpmi has a bug in exception handling so the actually diffs from jit-analyze are not interesting. I will investigate further on Monday. On manual inspection we now will not fast tail call for SIMD types more often. This happens infrequently, but will be fixed with the work @jakobbotsch is doing in LowerFastTail call. In the meantime, it is more important to be correct then continue to fast tail call. |
Diffs, note the percentages are off due to an issue with PAL_TRY exception filtering. The is run over a superpmi diff of a superpmi collection of the test assets. |
|
Change has been previously validated. Merging. |
* Do not fast tail call if caller has multislot structs * apply patch * Address offline feedback
* Do not fast tail call if caller has multislot structs * apply patch * Address offline feedback
* Use fgInitArgInfo in fgCanFastTailCall This leverages the work done in #19658 to use fgInitArgInfo in fgCanFastTailCall. This removes much of the duplicate ABI code that was required before #19658. In addition, the change more clearly explains the issues with LowerFastTailCall and more clearly bails on when it can and cannot fastTailCall. Note: Part of the old logic would report no to a fastTailCall on Windows AMD64, if the struct was a power of two (engregisterable). This has been removed; however, it is unclear currently whether LowerFastTailCall/Codgen will support the change. * Address pr feedback for FastTailCallCandidates * Update variable name based on rebase * Fix comment headers based on feedback * More feedback addressed * Fix rebase error * Address feedback and correctly bail on byref args * Restrict to only bail on byref struct args * Correctly used computations from fgArgInfo * Correctly re-init arg infor for explicit tailcalls This is required because morphTailCall modifies the argument list. It would be nice in the future to go through each argument on subsequent calls to fgInitArgInfo to verify there have been no changes. * Fix x86 assert * Address PR feedback related to recomputing initArgs * Fix comment * Update fgCanFastTailCall header * Address PR feedback * Apply format patch * Correctly reset arginfo after morphtailcall * Commit does several small things, and fixes a bug Addresses PR feedback Removes dead code Changes to bail a fast tail call when the caller has a multi slot struct * Fix windows build * Address pr feedback * Fix arm and x86 builds * apply format patch and remove #25885 * Rebase on master * Apply format patch
…#25885) * Do not fast tail call if caller has multislot structs * apply patch * Address offline feedback Commit migrated from dotnet/coreclr@059604d
* Use fgInitArgInfo in fgCanFastTailCall This leverages the work done in dotnet/coreclr#19658 to use fgInitArgInfo in fgCanFastTailCall. This removes much of the duplicate ABI code that was required before dotnet/coreclr#19658. In addition, the change more clearly explains the issues with LowerFastTailCall and more clearly bails on when it can and cannot fastTailCall. Note: Part of the old logic would report no to a fastTailCall on Windows AMD64, if the struct was a power of two (engregisterable). This has been removed; however, it is unclear currently whether LowerFastTailCall/Codgen will support the change. * Address pr feedback for FastTailCallCandidates * Update variable name based on rebase * Fix comment headers based on feedback * More feedback addressed * Fix rebase error * Address feedback and correctly bail on byref args * Restrict to only bail on byref struct args * Correctly used computations from fgArgInfo * Correctly re-init arg infor for explicit tailcalls This is required because morphTailCall modifies the argument list. It would be nice in the future to go through each argument on subsequent calls to fgInitArgInfo to verify there have been no changes. * Fix x86 assert * Address PR feedback related to recomputing initArgs * Fix comment * Update fgCanFastTailCall header * Address PR feedback * Apply format patch * Correctly reset arginfo after morphtailcall * Commit does several small things, and fixes a bug Addresses PR feedback Removes dead code Changes to bail a fast tail call when the caller has a multi slot struct * Fix windows build * Address pr feedback * Fix arm and x86 builds * apply format patch and remove dotnet/coreclr#25885 * Rebase on master * Apply format patch Commit migrated from dotnet/coreclr@f8f0c55
With more eyes on LowerFastTailCall, @jakobbotsch and I have found another SBC bug. We have verified that this causes silent bad codegen on <= coreclr 3.0. Thank you @jakobbotsch for help on a functioning repro.