diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2022-01-03 05:20:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-03 05:20:00 +0300 |
commit | 6f1e03f1bfa04e00627173e51790df700438443e (patch) | |
tree | a69313ae9f9d0f6367cd7a33b943d41a26bcb809 /src/coreclr | |
parent | 2282b00b4bb9754088da92f45e5ac7bda16b58ec (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.cpp | 9 |
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", |