Skip to content

Investigate optimizing away Span<class> type checks #7646

@JosephTremoulet

Description

@JosephTremoulet

The Span constructors that take arrays have checks to ensure that the dynamic type of the T[] argument is exactly T[] (as opposed to U[] for some subtype U of T), since Spans, unlike arrays, aren't covariant. We should see if there are cases where the JIT can optimize away this check (when the constructor gets inlined), such as when T is a sealed type or when we can propagate an exact type from a new T[] expression.
category:cq
theme:optimization
skill-level:expert
cost:medium

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions