summaryrefslogtreecommitdiff
path: root/src/jit/earlyprop.cpp
diff options
context:
space:
mode:
authorCarol Eidt <carol.eidt@microsoft.com>2016-09-27 15:19:18 -0700
committerCarol Eidt <carol.eidt@microsoft.com>2016-10-20 08:27:03 -0700
commitc4b661d90ed2921d37b95c8f2a2d6922b2771f92 (patch)
tree181b0214e8fc46ea9fa86dc64697c480aaeb6ce2 /src/jit/earlyprop.cpp
parenta410ded42ba14ae87efa5e9627a5d300cc9aadc1 (diff)
downloadcoreclr-c4b661d90ed2921d37b95c8f2a2d6922b2771f92.tar.gz
coreclr-c4b661d90ed2921d37b95c8f2a2d6922b2771f92.tar.bz2
coreclr-c4b661d90ed2921d37b95c8f2a2d6922b2771f92.zip
Enable optimization of structs
Remove many of the restrictions on structs that were added to preserve behavior of the old IR form. Change the init block representation to not require changing the parent when a copy block is changed to an init.
Diffstat (limited to 'src/jit/earlyprop.cpp')
-rw-r--r--src/jit/earlyprop.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/jit/earlyprop.cpp b/src/jit/earlyprop.cpp
index 966063ce32..80ec6a01d2 100644
--- a/src/jit/earlyprop.cpp
+++ b/src/jit/earlyprop.cpp
@@ -237,12 +237,8 @@ bool Compiler::optEarlyPropRewriteTree(GenTreePtr tree)
objectRefPtr = tree->gtOp.gtOp1;
propKind = optPropKind::OPK_ARRAYLEN;
}
- else if ((tree->OperGet() == GT_IND) && !varTypeIsStruct(tree))
+ else if (tree->OperIsIndir())
{
- // TODO-1stClassStructs: The above condition should apply equally to all indirections,
- // but previously the implicit indirections due to a struct assignment were not
- // considered, so we are currently limiting it to non-structs to preserve existing
- // behavior.
// optFoldNullCheck takes care of updating statement info if a null check is removed.
optFoldNullCheck(tree);
@@ -258,7 +254,7 @@ bool Compiler::optEarlyPropRewriteTree(GenTreePtr tree)
return false;
}
- objectRefPtr = tree->gtOp.gtOp1;
+ objectRefPtr = tree->AsIndir()->Addr();
propKind = optPropKind::OPK_OBJ_GETTYPE;
}
else
@@ -515,8 +511,8 @@ void Compiler::optFoldNullCheck(GenTreePtr tree)
return;
}
- assert(tree->OperGet() == GT_IND);
- if (tree->gtGetOp1()->OperGet() == GT_LCL_VAR)
+ assert(tree->OperIsIndir());
+ if (tree->AsIndir()->Addr()->OperGet() == GT_LCL_VAR)
{
// Check if we have the pattern above and find the nullcheck node if we do.