Skip to content

Conversation

@anthonycanino
Copy link
Contributor

This PR adjust GenTreeJitIntrinsic to save the base type of SIMD operation as a var_types and not CorInfoType. This is done to allow SIMD operations on types that are not part of the CIL.

Some notes on the changes:

  1. simdBaseJitType has been renamed to simdBaseType and most flows that previous had both a simdBaseJitType and simdBaseType now only use the simdBaseType.
  2. simdBaseType should now refer to the type returned via JitType2PreciseVarType.
  3. Some instances required the less precise, JitType2VarType.
  4. gtAuxiliaryJitType has been left unchanged. Some new functions have been introduced called getCorBaseTypeXX that keep the original behavior.

If we decide to also change gtAuxiliaryJitType I can make the changes and refactor things a bit more.

Current opening PR as draft to get a test run.

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

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors GenTreeJitIntrinsic to store the base type for SIMD operations as var_types instead of CorInfoType, enabling support for SIMD operations on types not part of the CIL. The changes include:

  • Renaming simdBaseJitType to simdBaseType throughout the codebase
  • Converting CorInfoType parameters to var_types in SIMD-related functions
  • Introducing new helper functions like getBaseTypeForPrimitiveNumericClass and getBaseTypeAndSizeOfSIMDType
  • Maintaining backward compatibility through new getCorBaseTypeXX functions

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
valuenum.h Updated signature of VNForSimdType to use var_types instead of CorInfoType
valuenum.cpp Changed parameter types in VNForSimdType and updated call sites
simd.cpp Added new getBaseTypeAndSizeOfSIMDType function returning var_types, refactored from original implementation
rationalize.cpp Updated all SIMD intrinsic operations to use var_types for base type tracking
optimizemaskconversions.cpp Changed mask conversion tracking to use var_types
morph.cpp Updated HWIntrinsic morphing to use var_types throughout
lowerxarch.cpp Converted all SIMD lowering operations to use var_types
lowerarmarch.cpp Updated ARM-specific SIMD lowering to use var_types
lower.h Changed function signature for InsertNewSimdCreateScalarUnsafeNode
lower.cpp Updated implementation to use var_types
lclvars.cpp Changed local variable promotion to use var_types
lclmorph.cpp Updated local morphing to use var_types
importervectorization.cpp Changed vectorization import to use var_types
importercalls.cpp Updated intrinsic call handling to use var_types with JitType2PreciseVarType conversions
importer.cpp Changed impNormStructType signature and implementation
hwintrinsicxarch.cpp Updated x86/x64 intrinsic handling with extensive conversions from CorInfoType to var_types
hwintrinsiccodegenxarch.cpp Updated codegen to use var_types
hwintrinsicarm64.cpp Converted ARM64 intrinsic handling to use var_types throughout

@tannergooding
Copy link
Member

cc. @dotnet/jit-contrib, @EgorBo, @jakobbotsch for secondary review

@anthonycanino
Copy link
Contributor Author

@tannergooding @jakobbotsch I've made the requested changes, can I get a secondary review on the PR?

@AndyAyersMS
Copy link
Member

Merging up

@anthonycanino
Copy link
Contributor Author

@dotnet/intel is there something more needed for this PR? Can we get an additional review?

@kg
Copy link
Member

kg commented Dec 1, 2025

FYI, due to repository policy we can't hit the merge button until all comments are resolved.

@kg
Copy link
Member

kg commented Dec 1, 2025

LGTM. Once checks pass I will make sure the reviewers are okay with a merge.

@tannergooding
Copy link
Member

Once checks pass I will make sure the reviewers are okay with a merge.

My sign-off is still good. Was just waiting for the secondary sign-off from the codegen team to ensure appropriate eyes have looked over the changes

@kg
Copy link
Member

kg commented Dec 1, 2025

Once checks pass I will make sure the reviewers are okay with a merge.

My sign-off is still good. Was just waiting for the secondary sign-off from the codegen team to ensure appropriate eyes have looked over the changes

I think some people are OOO but I will try to find someone.

@tannergooding tannergooding merged commit e4f710e into dotnet:main Dec 1, 2025
108 of 112 checks passed
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.

5 participants