dotnet / dotnet/runtime

JIT bails on for some multi-dimensional array expansions

Open
#131,887 3 comments 0 reactions 0 assignees View on GitHub
area-CodeGen-coreclr
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

On targets without JIT this causes fallback to interpreter since crossgen2 does not support precompiling md array intrinsics. We can solve that by guaranteeing the expansion for all cases.

Currently we have 3 separate bailouts in `impArrayAccessIntrinsic`:

1. Rank <= 1
1. Rank > 3
1. `Set`/`Address` requiring a runtime type check

We should consider addressing 2 and 3.

Contributor guide

Open the contributing guide

Research direction

Start with the JIT entry point `impArrayAccessIntrinsic` and trace its three bailout conditions, especially rank greater than 3 and `Set`/`Address` operations requiring a runtime type check. Read how crossgen2 handles multi-dimensional array intrinsics and verify that the relevant cases expand instead of falling back to the interpreter.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.