-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
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.