summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2017-12-01 14:57:24 -0800
committerGitHub <noreply@github.com>2017-12-01 14:57:24 -0800
commit49afb352748ffc2f3272b3c9f62426b0e95a93d7 (patch)
tree5bd0659a2ab1e045c808527d05d875f40b68cfa7
parent600902ddd4f11172e1befa64925c2394852063ef (diff)
parentf78693ead5f5840f3d443a4fb1975e6d46bc9dd4 (diff)
downloadcoreclr-49afb352748ffc2f3272b3c9f62426b0e95a93d7.tar.gz
coreclr-49afb352748ffc2f3272b3c9f62426b0e95a93d7.tar.bz2
coreclr-49afb352748ffc2f3272b3c9f62426b0e95a93d7.zip
Merge pull request #15270 from sdmaclea/PR-ARM64-JITSTRESS-lvaStressLclFldCB
[ARM64] Align Compiler::lvaStressLclFldCB padding
-rw-r--r--src/jit/codegencommon.cpp22
-rw-r--r--src/jit/lclvars.cpp10
2 files changed, 18 insertions, 14 deletions
diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp
index acdc7fad2b..c741a668c3 100644
--- a/src/jit/codegencommon.cpp
+++ b/src/jit/codegencommon.cpp
@@ -1684,7 +1684,7 @@ void CodeGen::genAdjustStackLevel(BasicBlock* block)
#endif // !FEATURE_FIXED_OUT_ARGS
}
-#ifdef _TARGET_ARM_
+#ifdef _TARGET_ARMARCH_
// return size
// alignmentWB is out param
unsigned CodeGenInterface::InferOpSizeAlign(GenTreePtr op, unsigned* alignmentWB)
@@ -1724,7 +1724,8 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTreePtr op, unsigned* align
{
CORINFO_CLASS_HANDLE clsHnd = op->AsObj()->gtClass;
opSize = compiler->info.compCompHnd->getClassSize(clsHnd);
- alignment = roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
+ alignment =
+ (unsigned)roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
}
else if (op->gtOper == GT_LCL_VAR)
{
@@ -1732,11 +1733,13 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTreePtr op, unsigned* align
LclVarDsc* varDsc = compiler->lvaTable + varNum;
assert(varDsc->lvType == TYP_STRUCT);
opSize = varDsc->lvSize();
+#ifndef _TARGET_64BIT_
if (varDsc->lvStructDoubleAlign)
{
alignment = TARGET_POINTER_SIZE * 2;
}
else
+#endif // !_TARGET_64BIT_
{
alignment = TARGET_POINTER_SIZE;
}
@@ -1750,13 +1753,13 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTreePtr op, unsigned* align
if (op2->IsIconHandle(GTF_ICON_CLASS_HDL))
{
CORINFO_CLASS_HANDLE clsHnd = (CORINFO_CLASS_HANDLE)op2->gtIntCon.gtIconVal;
- opSize = roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
- alignment =
- roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
+ opSize = (unsigned)roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
+ alignment = (unsigned)roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd),
+ TARGET_POINTER_SIZE);
}
else
{
- opSize = op2->gtIntCon.gtIconVal;
+ opSize = (unsigned)op2->gtIntCon.gtIconVal;
GenTreePtr op1 = op->gtOp.gtOp1;
assert(op1->OperGet() == GT_LIST);
GenTreePtr dstAddr = op1->gtOp.gtOp1;
@@ -1787,8 +1790,9 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTreePtr op, unsigned* align
{
CORINFO_CLASS_HANDLE clsHnd = op->gtArgPlace.gtArgPlaceClsHnd;
assert(clsHnd != 0);
- opSize = roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
- alignment = roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
+ opSize = (unsigned)roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
+ alignment =
+ (unsigned)roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
}
else
{
@@ -1804,7 +1808,7 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTreePtr op, unsigned* align
return opSize;
}
-#endif // _TARGET_ARM_
+#endif // _TARGET_ARMARCH_
/*****************************************************************************
*
diff --git a/src/jit/lclvars.cpp b/src/jit/lclvars.cpp
index 900cbb65e8..0aa3d85311 100644
--- a/src/jit/lclvars.cpp
+++ b/src/jit/lclvars.cpp
@@ -7300,13 +7300,13 @@ Compiler::fgWalkResult Compiler::lvaStressLclFldCB(GenTreePtr* pTree, fgWalkData
// Calculate padding
unsigned padding = LCL_FLD_PADDING(lclNum);
-#ifdef _TARGET_ARM_
- // We need to support alignment requirements to access memory on ARM
+#ifdef _TARGET_ARMARCH_
+ // We need to support alignment requirements to access memory on ARM ARCH
unsigned alignment = 1;
pComp->codeGen->InferOpSizeAlign(lcl, &alignment);
- alignment = roundUp(alignment, TARGET_POINTER_SIZE);
- padding = roundUp(padding, alignment);
-#endif // _TARGET_ARM_
+ alignment = (unsigned)roundUp(alignment, TARGET_POINTER_SIZE);
+ padding = (unsigned)roundUp(padding, alignment);
+#endif // _TARGET_ARMARCH_
// Change the variable to a TYP_BLK
if (varType != TYP_BLK)