Skip to content

JIT: arrays are now not always TYP_REF #115801

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

Merged
merged 1 commit into from
May 21, 2025
Merged

Conversation

AndyAyersMS
Copy link
Member

Remove some asserts saying otherwise.

Fixes #115495.

Remove some asserts saying otherwise.

Fixes dotnet#115495.
@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 20:37
@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 May 20, 2025
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 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 addresses runtime issue #115495 by adding a new JIT regression test and updating the SIMD code to remove incorrect assumptions about array reference types.

  • Introduces a new test project (Runtime_115495) with optimized build settings.
  • Adds a C# test (Runtime_115495.cs) that verifies Vector3.GetHashCode behavior and exercises array-based loops.
  • Removes two assert calls in simd.cpp that assumed array elements were always TYP_REF.

Reviewed Changes

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

File Description
src/tests/JIT/Regression/JitBlue/Runtime_115495/Runtime_115495.csproj New test project without target framework specified
src/tests/JIT/Regression/JitBlue/Runtime_115495/Runtime_115495.cs C# test case with custom Assert and array-based checksum logic
src/coreclr/jit/simd.cpp Removed outdated assert checks for TYP_REF on array refs
Comments suppressed due to low confidence (4)

src/tests/JIT/Regression/JitBlue/Runtime_115495/Runtime_115495.cs:17

  • [nitpick] This Assert class shadows Xunit.Assert, which could be confusing. Consider renaming it (e.g., SimpleAssert) to avoid conflicts.
public class Assert

src/tests/JIT/Regression/JitBlue/Runtime_115495/Runtime_115495.cs:35

  • [nitpick] The static delegate field multiply should use PascalCase (Multiply) or include a suffix (multiplyFunc) to follow .NET naming conventions.
static Func<int, int> multiply = x => x * 2;

src/tests/JIT/Regression/JitBlue/Runtime_115495/Runtime_115495.cs:55

  • Currently the test always enters the foreach branch. Add a variant where checksum % 4 != 0 to cover the branch where the loop is skipped.
if (checksum % 4 == 0)

src/tests/JIT/Regression/JitBlue/Runtime_115495/Runtime_115495.csproj:3

  • The new project file lacks a <TargetFramework> element, so it may not compile or run tests. Please specify a target framework (e.g., net7.0 or net8.0).
<Optimize>True</Optimize>

@AndyAyersMS
Copy link
Member Author

@dotnet/jit-contrib PTAL

@AndyAyersMS
Copy link
Member Author

/ba-g this is just removing an assert

@AndyAyersMS AndyAyersMS merged commit c446706 into dotnet:main May 21, 2025
105 of 115 checks passed
SimaTian pushed a commit that referenced this pull request May 27, 2025
Remove some asserts saying otherwise.

Fixes #115495.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JIT: Assertion failed 'op1ArrayRef->TypeGet() == TYP_REF' during 'Morph - Structs/AddrExp'
2 participants