summaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorCarol Eidt <carol.eidt@microsoft.com>2018-04-05 14:35:13 -0700
committerCarol Eidt <carol.eidt@microsoft.com>2018-04-05 14:35:13 -0700
commit2d44ad66203707398bd6a33cd2c676c07763419c (patch)
treee39255754517b80099bb1ea93d33d70908471cbf /src/jit
parent22b2d86b276d78794c1e102b0d10b2cf039a90e4 (diff)
downloadcoreclr-2d44ad66203707398bd6a33cd2c676c07763419c.tar.gz
coreclr-2d44ad66203707398bd6a33cd2c676c07763419c.tar.bz2
coreclr-2d44ad66203707398bd6a33cd2c676c07763419c.zip
Remove fgMorphLocalField invalid assert
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/morph.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp
index 22d6b619d5..0df36c953c 100644
--- a/src/jit/morph.cpp
+++ b/src/jit/morph.cpp
@@ -18410,31 +18410,29 @@ Compiler::fgWalkResult Compiler::fgMorphLocalField(GenTree* tree, fgWalkData* fg
#endif
)
{
- // There is an existing sub-field we can use
+ // There is an existing sub-field we can use.
tree->gtLclFld.SetLclNum(fieldLclIndex);
- // We need to keep the types 'compatible'. If we can switch back to a GT_LCL_VAR
- CLANG_FORMAT_COMMENT_ANCHOR;
-
-#ifdef _TARGET_ARM_
- assert(varTypeIsIntegralOrI(tree->TypeGet()) || varTypeIsFloating(tree->TypeGet()));
-#else
- assert(varTypeIsIntegralOrI(tree->TypeGet()));
-#endif
- if (varTypeCanReg(fldVarDsc->TypeGet()))
- {
- // If the type is integer-ish, then we can use it as-is
- tree->ChangeOper(GT_LCL_VAR);
- assert(tree->gtLclVarCommon.gtLclNum == fieldLclIndex);
- tree->gtType = fldVarDsc->TypeGet();
+ // The field must be an enregisterable type; otherwise it would not be a promoted field.
+ // The tree type may not match, e.g. for return types that have been morphed, but both
+ // must be enregisterable types.
+ // TODO-Cleanup: varTypeCanReg should presumably return true for SIMD types, but
+ // there may be places where that would violate existing assumptions.
+ var_types treeType = tree->TypeGet();
+ var_types fieldType = fldVarDsc->TypeGet();
+ assert((varTypeCanReg(treeType) || varTypeIsSIMD(treeType)) &&
+ (varTypeCanReg(fieldType) || varTypeIsSIMD(fieldType)));
+
+ tree->ChangeOper(GT_LCL_VAR);
+ assert(tree->gtLclVarCommon.gtLclNum == fieldLclIndex);
+ tree->gtType = fldVarDsc->TypeGet();
#ifdef DEBUG
- if (verbose)
- {
- printf("Replacing the GT_LCL_FLD in promoted struct with a local var:\n");
- fgWalkPre->printModified = true;
- }
-#endif // DEBUG
+ if (verbose)
+ {
+ printf("Replacing the GT_LCL_FLD in promoted struct with a local var:\n");
+ fgWalkPre->printModified = true;
}
+#endif // DEBUG
GenTree* parent = fgWalkPre->parentStack->Index(1);
if ((parent->gtOper == GT_ASG) && (parent->gtOp.gtOp1 == tree))