Skip to content

Unsafe.As being intrinsic has exposed a few JIT related issues #69505

@tannergooding

Description

@tannergooding

Issue

#68739 switched several APIs to be intrinsic to the JIT and have the respective IR imported directly by the JIT rather than go through inlining.

While this in general has been positive there have been a couple of issues related to Unsafe.As that have cropped up.

These issues don't appear to be related to the IR being "incorrect" but rather due to less spilling to locals and similar issues causing tree shapes that weren't encountered previously.

This has lead to at least one GC hole being exposed and is potentially related to other issues that have cropped up.

Proposed "Fix"

Given that it is generally desirable for this approach to be used "long term", but the issues that crop up are flaky by nature, it may be beneficial to provide a "switch" that allows this feature to be toggled on/off.

In particular, I propose we either provide a new COMPlus_* switch or FEATURE_* define that allows this functionality to be on by default for debug/checked builds and off by default for release builds.

If a COMPlus_* switch were defined then users could opt-into the functionality in release mode and if we ever changed the default they would have an "out" if any problematic behavior shows up later in an edge case scenario.

This would allow us to continue having the feature and getting failures raised until our confidence is high enough that they have been resolved so this can be enabled in production.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions