diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2016-12-07 09:02:02 -0800 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2016-12-07 09:03:53 -0800 |
commit | 95de3a09c7adca51e1f56eb295cfb1b6e26801db (patch) | |
tree | c06460eb732b862334a2dd558ed47d5928685a9e /src/jit | |
parent | cc4bbf63fe9ffe21237eb7c44f354911df90edf3 (diff) | |
download | coreclr-95de3a09c7adca51e1f56eb295cfb1b6e26801db.tar.gz coreclr-95de3a09c7adca51e1f56eb295cfb1b6e26801db.tar.bz2 coreclr-95de3a09c7adca51e1f56eb295cfb1b6e26801db.zip |
Remove a use of `gtGetOp` in earlyprop.
Instead, use `GenTreeIndir::Addr`, as some indirections are not simple
operators.
Fixes VSO 289704.
Diffstat (limited to 'src/jit')
-rw-r--r-- | src/jit/earlyprop.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/jit/earlyprop.cpp b/src/jit/earlyprop.cpp index 7bf6eabdfe..51de631d19 100644 --- a/src/jit/earlyprop.cpp +++ b/src/jit/earlyprop.cpp @@ -512,14 +512,17 @@ void Compiler::optFoldNullCheck(GenTreePtr tree) } assert(tree->OperIsIndir()); - if (tree->AsIndir()->Addr()->OperGet() == GT_LCL_VAR) + + GenTree* const addr = tree->AsIndir()->Addr(); + if (addr->OperGet() == GT_LCL_VAR) { // Check if we have the pattern above and find the nullcheck node if we do. // Find the definition of the indirected local (x in the picture) - GenTreePtr indLocalTree = tree->gtGetOp1(); - unsigned lclNum = indLocalTree->AsLclVarCommon()->GetLclNum(); - unsigned ssaNum = indLocalTree->AsLclVarCommon()->GetSsaNum(); + GenTreeLclVarCommon* const lclVarNode = addr->AsLclVarCommon(); + + const unsigned lclNum = lclVarNode->GetLclNum(); + const unsigned ssaNum = lclVarNode->GetSsaNum(); if (ssaNum != SsaConfig::RESERVED_SSA_NUM) { @@ -557,7 +560,7 @@ void Compiler::optFoldNullCheck(GenTreePtr tree) { // Walk from the use to the def in reverse execution order to see // if any nodes have unsafe side effects. - GenTreePtr currentTree = indLocalTree->gtPrev; + GenTreePtr currentTree = lclVarNode->gtPrev; bool isInsideTry = compCurBB->hasTryIndex(); bool canRemoveNullCheck = true; const unsigned maxNodesWalked = 25; |