From acb94026b6acdee774950b9398bdb17057890f3e Mon Sep 17 00:00:00 2001 From: Fei Peng Date: Fri, 24 Aug 2018 14:48:43 -0700 Subject: [PATCH] Improve struct promotion for 256-bit SIMD fields --- src/jit/lclvars.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jit/lclvars.cpp b/src/jit/lclvars.cpp index 70b6eee46c47..1aa9c1450365 100644 --- a/src/jit/lclvars.cpp +++ b/src/jit/lclvars.cpp @@ -1497,8 +1497,9 @@ void Compiler::lvaCanPromoteStructType(CORINFO_CLASS_HANDLE typeHnd, CLANG_FORMAT_COMMENT_ANCHOR; #if defined(FEATURE_SIMD) #if defined(_TARGET_XARCH_) - // This will allow promotion of 2 Vector fields on AVX2, or 4 Vector fields on SSE2. - const int MaxOffset = MAX_NumOfFieldsInPromotableStruct * XMM_REGSIZE_BYTES; + // This will allow promotion of 4 Vector fields on AVX2 or Vector256 on AVX, + // or 8 Vector/Vector128 fields on SSE2. + const int MaxOffset = MAX_NumOfFieldsInPromotableStruct * YMM_REGSIZE_BYTES; #elif defined(_TARGET_ARM64_) const int MaxOffset = MAX_NumOfFieldsInPromotableStruct * FP_REGSIZE_BYTES; #endif // defined(_TARGET_XARCH_) || defined(_TARGET_ARM64_)