From: Carol Eidt Date: Tue, 19 Jun 2018 20:35:02 +0000 (-0700) Subject: Fix struct promotion check for SIMD field (dotnet/coreclr#18548) X-Git-Tag: submit/tizen/20210909.063632~11030^2~4565 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dcaeb4d99835fb4929ef65afc8d70b0817229879;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix struct promotion check for SIMD field (dotnet/coreclr#18548) A struct can have `lvIsRegArg` true but have multiple SIMD fields if it is passed by reference. Commit migrated from https://github.com/dotnet/coreclr/commit/d3905518d08ca174ae631aebfe16314b885aa61a --- diff --git a/src/coreclr/src/jit/lclvars.cpp b/src/coreclr/src/jit/lclvars.cpp index e0e8f74..b36fcad 100644 --- a/src/coreclr/src/jit/lclvars.cpp +++ b/src/coreclr/src/jit/lclvars.cpp @@ -2011,7 +2011,7 @@ void Compiler::lvaPromoteStructVar(unsigned lclNum, lvaStructPromotionInfo* Stru fieldVarDsc->lvArgReg = varDsc->lvArgReg; fieldVarDsc->setPrefReg(varDsc->lvArgReg, this); // Set the preferred register #if FEATURE_MULTIREG_ARGS && defined(FEATURE_SIMD) - if (varTypeIsSIMD(fieldVarDsc)) + if (varTypeIsSIMD(fieldVarDsc) && !lvaIsImplicitByRefLocal(lclNum)) { // This field is a SIMD type, and will be considered to be passed in multiple registers // if the parent struct was. Note that this code relies on the fact that if there is