Skip to content

[RuntimeAsync] GS check at returns should be modeled via a register kill in LSRA #119949

@VSadov

Description

@VSadov

Re discussion: #119864 (comment)

The issue is not new, but async makes it worse.

When inserting GS check after GT_RETURN, we may need a temp register. We use platform-specific logic to figure which register is available, considering possible single/multi reg return values, a keep-alive this, etc. In async case one more register is in use for the continuation return and the logic becomes more complex and on x86 it is now possible to find no free registers.
In such case we push/pop a register around GS check, but on x86 it is possible that all scratch registers contain GC pointers, and since we are not in the epilog yet, we need to force no-gc.

All this feels fairly fragile and a more general solution by modeling the register use in LSRA would be preferrable.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions