Skip to content

Do not run stackLevelSetter except for x86. #42673

@sandreenko

Description

@sandreenko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions