Skip to content

Simplify 64-bit platform conditions #115083

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Simplify 64-bit platform conditions #115083

wants to merge 2 commits into from

Conversation

am11
Copy link
Member

@am11 am11 commented Apr 26, 2025

A few conditions which no longer need the full list of architectures.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 26, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 26, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@am11 am11 requested a review from MichalStrehovsky as a code owner April 27, 2025 10:13
@@ -6739,7 +6739,7 @@ int Compiler::lvaToCallerSPRelativeOffset(int offset, bool isFpBased, bool forRo
offset += codeGen->genCallerSPtoInitialSPdelta();
}

#if defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)
#ifdef TARGET_64BIT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does FEATURE_ON_STACK_REPLACEMENT break the build here? (The build log is no longer available.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was failing for x86_x64 variant of altjit, because FEATURE_ON_STACK_REPLACEMENT was true but TARGET_AMD64 and ARM64 were false:

  [ 82%] Building CXX object tools/superpmi/superpmi/CMakeFiles/superpmi.dir/__/superpmi-shared/simpletimer.cpp.o
  /__w/1/s/src/coreclr/jit/lclvars.cpp:6766:19: error: use of undeclared identifier 'adjustment'
   6766 |         offset -= adjustment;
        |                   ^
  [ 82%] Building CXX object jit/CMakeFiles/clrjit_win_x86_x64.dir/likelyclass.cpp.o

(I have devops page opened in a tab 🙂)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this means that FEATURE_ON_STACK_REPLACEMENT is not defined correctly for cross-targeting JITs.

@@ -6739,7 +6739,7 @@ int Compiler::lvaToCallerSPRelativeOffset(int offset, bool isFpBased, bool forRo
offset += codeGen->genCallerSPtoInitialSPdelta();
}

#if defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)
#ifdef TARGET_64BIT
if (forRootFrame && opts.IsOSR())
Copy link
Member

@jkotas jkotas Apr 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to change #elif defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) into just #else since the code under #else is likely going to be right for all future architectures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants