JIT: work around issue with GDV and Bboxing (#56126)
authorAndy Ayers <andya@microsoft.com>
Thu, 22 Jul 2021 21:56:31 +0000 (14:56 -0700)
committerGitHub <noreply@github.com>
Thu, 22 Jul 2021 21:56:31 +0000 (14:56 -0700)
commit47e82c1f625428c02eb6b31d7a7400c53a8c24b9
treec3c579fc14b44313b146c9fd58e82381cc1cb362
parenta81fee275fbf5e009351b36edc3582f5121319f1
JIT: work around issue with GDV and Bboxing (#56126)

If a call is a GDV candidate and returns a struct via hidden buffer, and that
return value is immediately boxed, the GDV expansion will produce IR in
incorrect order, leading to bad codegen.

This seems to be a rare enough sequence that disabling GDV is a reasonable
workaround for now.

Actually the box expansion is producing IR in the wrong order and GDV fails
to fix the order (unlike inlining, which does fix the order).

Longer term we should avoid producing out of order IR. But that seems a bit
more complicated and may have other CQ impact.

Added a test case.

Closes #53549.
src/coreclr/jit/importer.cpp
src/tests/JIT/Regression/JitBlue/Runtime_53549/Runtime_53549.cs [new file with mode: 0644]
src/tests/JIT/Regression/JitBlue/Runtime_53549/Runtime_53549.csproj [new file with mode: 0644]