Skip to content

JIT: Cold code inlining decisions are incorrectly used later #115918

Open
@pentp

Description

@pentp

Description

It seems that inlining decisions made in cold code blocks are being remembered by JIT and blindly used later in completely unrelated methods.

Reproduction Steps

https://godbolt.org/z/9zas8rc6h

Expected behavior

C:InnocentMethod implicitly converts the provided Span into a ReadOnlySpan without using a op_Implicit call.

Actual behavior

Trivially inline-able methods (even intrinsic methods) are not inlined in normal methods.

Regression?

.NET 7 seems to not have this issue.

Known Workarounds

No reliable workarounds, can reduce chances by avoiding any potential inlining in cold code blocks or re-ordering method JIT compilation order.

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

Relationships

None yet

Development

No branches or pull requests

Issue actions