From 2b52df83546e81a2e591584f29949a1c6ae36ce7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 10:38:23 -0700 Subject: [PATCH] [release/7.0-rc1] Disable matching constants for vectors that needs upper half to be save/restore (#74192) * Revert "Ensure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant (#70171)" This reverts commit 24f5de4bb10976dfb391e9b6affe5481f55a2d00. * Revert "Revert "Ensure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant (#70171)"" This reverts commit 984120f0cde0d26f9768112296e68164cfe76c8e. * Add partial save check * Use the correct register type Co-authored-by: Kunal Pathak --- src/coreclr/jit/lsra.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/coreclr/jit/lsra.cpp b/src/coreclr/jit/lsra.cpp index 144d5f3ab1775..4417858838d54 100644 --- a/src/coreclr/jit/lsra.cpp +++ b/src/coreclr/jit/lsra.cpp @@ -2721,7 +2721,11 @@ bool LinearScan::isMatchingConstant(RegRecord* physRegRecord, RefPosition* refPo case GT_CNS_VEC: { - return GenTreeVecCon::Equals(refPosition->treeNode->AsVecCon(), otherTreeNode->AsVecCon()); + return +#if FEATURE_PARTIAL_SIMD_CALLEE_SAVE + !Compiler::varTypeNeedsPartialCalleeSave(physRegRecord->assignedInterval->registerType) && +#endif + GenTreeVecCon::Equals(refPosition->treeNode->AsVecCon(), otherTreeNode->AsVecCon()); } default: