Skip to content
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

Do not run stackLevelSetter except for x86. #42673

Closed
sandreenko opened this issue Sep 24, 2020 · 3 comments
Closed

Do not run stackLevelSetter except for x86. #42673

sandreenko opened this issue Sep 24, 2020 · 3 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@sandreenko
Copy link
Contributor

sandreenko commented Sep 24, 2020

Stack level setter is required only for x86, on other platforms, it could be skipped or run only in debug.

However, there is an issue with disabling it:
Stack level setter has code that was supposed to be run only on x86 but is running on all platforms currently:

if (maxStackLevel >= sizeof(unsigned))
{
#ifdef DEBUG
if (comp->verbose)
{
printf("Too many pushed arguments for an ESP based encoding, forcing an EBP frame\n");
}
#endif
comp->codeGen->setFramePointerRequired(true);
}
}
//------------------------------------------------------------------------

If you put it under TARGET_X86 as I did in #42197 you will see a big size regressions because you will have to encode bigger offset (from the rsp instead of saved rsp+offset):

-000013 lea      rbp, [rsp+C0H]
-000104 mov      dword ptr [V04 rbp+30H], r15d
-000108 mov      dword ptr [V06 rbp+40H], r12d
-00010C mov      dword ptr [V07 rbp+48H], r13d
-
+000102 mov      dword ptr [V04 rsp+F0H], r14d
+00010A mov      dword ptr [V06 rsp+100H], r15d
+000112 mov      dword ptr [V07 rsp+108H], r12d

and also see bunch of new bad LSRA decisions.

category:implementation
theme:throughput
skill-level:beginner
cost:small

@sandreenko sandreenko added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 24, 2020
@sandreenko sandreenko added this to the 6.0.0 milestone Sep 24, 2020
@sandreenko sandreenko self-assigned this Sep 24, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Sep 24, 2020
@jeffschwMSFT jeffschwMSFT removed the untriaged New issue has not been triaged by the area owner label Sep 24, 2020
@BruceForstall BruceForstall added the JitUntriaged CLR JIT issues needing additional triage label Oct 28, 2020
@BruceForstall BruceForstall removed the JitUntriaged CLR JIT issues needing additional triage label Nov 7, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 7, 2020
@dotnet dotnet unlocked this conversation Dec 7, 2020
@JulieLeeMSFT JulieLeeMSFT added the needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration label Mar 23, 2021
@sandreenko sandreenko added Priority:2 Work that is important, but not critical for the release and removed needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration labels Apr 5, 2021
@sandreenko sandreenko modified the milestones: 6.0.0, Future Apr 5, 2021
@sandreenko
Copy link
Contributor Author

Moving to future unless we have time after #7996 to do this.

@BrianBohe BrianBohe assigned BrianBohe and unassigned sandreenko Oct 14, 2022
@BruceForstall BruceForstall removed the Priority:2 Work that is important, but not critical for the release label May 17, 2023
@AndyAyersMS
Copy link
Member

I am now co-opting this phase to also scan for unused throw helper blocks, so we will just be running it always.

@AndyAyersMS
Copy link
Member

#95379 now uses this phase for trimming throw helpers. So, closing this.

TP hit from running this phase (non-x86) is around 0.2%

@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

No branches or pull requests

7 participants