Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-01-03 05:20:00 +0300
committerGitHub <noreply@github.com>2022-01-03 05:20:00 +0300
commit6f1e03f1bfa04e00627173e51790df700438443e (patch)
treea69313ae9f9d0f6367cd7a33b943d41a26bcb809 /src/coreclr
parent2282b00b4bb9754088da92f45e5ac7bda16b58ec (diff)
[release/6.0] Do not promote struct locals with holes (#62738)
* Make sure the combined field size matches the struct size * Fix the condition * Update test and include containHoles condition Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
Diffstat (limited to 'src/coreclr')
-rw-r--r--src/coreclr/jit/lclvars.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp
index df083c7c3a7..6b7032336bd 100644
--- a/src/coreclr/jit/lclvars.cpp
+++ b/src/coreclr/jit/lclvars.cpp
@@ -2103,8 +2103,13 @@ bool Compiler::StructPromotionHelper::ShouldPromoteStructVar(unsigned lclNum)
// multiple registers?
if (compiler->lvaIsMultiregStruct(varDsc, compiler->info.compIsVarArgs))
{
- if ((structPromotionInfo.fieldCnt != 2) &&
- !((structPromotionInfo.fieldCnt == 1) && varTypeIsSIMD(structPromotionInfo.fields[0].fldType)))
+ if (structPromotionInfo.containsHoles && structPromotionInfo.customLayout)
+ {
+ JITDUMP("Not promoting multi-reg struct local V%02u with holes.\n", lclNum);
+ shouldPromote = false;
+ }
+ else if ((structPromotionInfo.fieldCnt != 2) &&
+ !((structPromotionInfo.fieldCnt == 1) && varTypeIsSIMD(structPromotionInfo.fields[0].fldType)))
{
JITDUMP("Not promoting multireg struct local V%02u, because lvIsParam is true, #fields != 2 and it's "
"not a single SIMD.\n",