summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2018-03-30 23:50:07 -0700
committerGitHub <noreply@github.com>2018-03-30 23:50:07 -0700
commit42ae2c03de22d32f96890077e109e1f9e57451d1 (patch)
tree8c209ab483314f6e872b229587e72608f445af02 /src
parent48ec2b058e182a0191af04ca7cb400e53e273b64 (diff)
parent6b07baf10683c84809e75ead4a4227e8e139d348 (diff)
downloadcoreclr-42ae2c03de22d32f96890077e109e1f9e57451d1.tar.gz
coreclr-42ae2c03de22d32f96890077e109e1f9e57451d1.tar.bz2
coreclr-42ae2c03de22d32f96890077e109e1f9e57451d1.zip
Merge pull request #17329 from briansull/struct-gscheck-fix
Reject struct promotion of parameters when -GS checks are enabled
Diffstat (limited to 'src')
-rw-r--r--src/jit/lclvars.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/jit/lclvars.cpp b/src/jit/lclvars.cpp
index 82c37d6bb8..765a2eee3f 100644
--- a/src/jit/lclvars.cpp
+++ b/src/jit/lclvars.cpp
@@ -1746,6 +1746,16 @@ void Compiler::lvaCanPromoteStructVar(unsigned lclNum, lvaStructPromotionInfo* S
// profitably promoted.
if (varDsc->lvIsUsedInSIMDIntrinsic())
{
+ JITDUMP(" struct promotion of V%02u is disabled because lvIsUsedInSIMDIntrinsic()\n", lclNum);
+ StructPromotionInfo->canPromote = false;
+ return;
+ }
+
+ // Reject struct promotion of parameters when -GS stack reordering is enabled
+ // as we could introduce shadow copies of them.
+ if (varDsc->lvIsParam && compGSReorderStackLayout)
+ {
+ JITDUMP(" struct promotion of V%02u is disabled because lvIsParam and compGSReorderStackLayout\n", lclNum);
StructPromotionInfo->canPromote = false;
return;
}
@@ -1757,6 +1767,7 @@ void Compiler::lvaCanPromoteStructVar(unsigned lclNum, lvaStructPromotionInfo* S
// TODO-PERF - Allow struct promotion for HFA register arguments
if (varDsc->lvIsHfaRegArg())
{
+ JITDUMP(" struct promotion of V%02u is disabled because lvIsHfaRegArg()\n", lclNum);
StructPromotionInfo->canPromote = false;
return;
}
@@ -1764,7 +1775,7 @@ void Compiler::lvaCanPromoteStructVar(unsigned lclNum, lvaStructPromotionInfo* S
#if !FEATURE_MULTIREG_STRUCT_PROMOTE
if (varDsc->lvIsMultiRegArg)
{
- JITDUMP("Skipping V%02u: marked lvIsMultiRegArg.\n", lclNum);
+ JITDUMP(" struct promotion of V%02u is disabled because lvIsMultiRegArg\n", lclNum);
StructPromotionInfo->canPromote = false;
return;
}
@@ -1772,7 +1783,7 @@ void Compiler::lvaCanPromoteStructVar(unsigned lclNum, lvaStructPromotionInfo* S
if (varDsc->lvIsMultiRegRet)
{
- JITDUMP("Skipping V%02u: marked lvIsMultiRegRet.\n", lclNum);
+ JITDUMP(" struct promotion of V%02u is disabled because lvIsMultiRegRet\n", lclNum);
StructPromotionInfo->canPromote = false;
return;
}