summaryrefslogtreecommitdiff
path: root/src/jit/earlyprop.cpp
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-11-03 15:33:08 -0700
committerGitHub <noreply@github.com>2016-11-03 15:33:08 -0700
commitfa06cedfc1351c03e86ef95cdd8b9020c814a4c8 (patch)
tree66b53b9c2342f2a604cc55c949ac8a690317cac2 /src/jit/earlyprop.cpp
parent552dae981e06efa059ac6e5d3bb326b54fc7eabe (diff)
downloadcoreclr-fa06cedfc1351c03e86ef95cdd8b9020c814a4c8.tar.gz
coreclr-fa06cedfc1351c03e86ef95cdd8b9020c814a4c8.tar.bz2
coreclr-fa06cedfc1351c03e86ef95cdd8b9020c814a4c8.zip
Revert "Enable optimization of structs"
Diffstat (limited to 'src/jit/earlyprop.cpp')
-rw-r--r--src/jit/earlyprop.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/jit/earlyprop.cpp b/src/jit/earlyprop.cpp
index 80ec6a01d2..966063ce32 100644
--- a/src/jit/earlyprop.cpp
+++ b/src/jit/earlyprop.cpp
@@ -237,8 +237,12 @@ bool Compiler::optEarlyPropRewriteTree(GenTreePtr tree)
objectRefPtr = tree->gtOp.gtOp1;
propKind = optPropKind::OPK_ARRAYLEN;
}
- else if (tree->OperIsIndir())
+ else if ((tree->OperGet() == GT_IND) && !varTypeIsStruct(tree))
{
+ // 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);
@@ -254,7 +258,7 @@ bool Compiler::optEarlyPropRewriteTree(GenTreePtr tree)
return false;
}
- objectRefPtr = tree->AsIndir()->Addr();
+ objectRefPtr = tree->gtOp.gtOp1;
propKind = optPropKind::OPK_OBJ_GETTYPE;
}
else
@@ -511,8 +515,8 @@ void Compiler::optFoldNullCheck(GenTreePtr tree)
return;
}
- assert(tree->OperIsIndir());
- if (tree->AsIndir()->Addr()->OperGet() == GT_LCL_VAR)
+ assert(tree->OperGet() == GT_IND);
+ if (tree->gtGetOp1()->OperGet() == GT_LCL_VAR)
{
// Check if we have the pattern above and find the nullcheck node if we do.