diff options
author | Carol Eidt <carol.eidt@microsoft.com> | 2016-07-20 23:07:32 -0700 |
---|---|---|
committer | Carol Eidt <carol.eidt@microsoft.com> | 2016-09-01 12:23:30 -0700 |
commit | cbaf04647bf4fddaeefb35af024b4d099ee4c25a (patch) | |
tree | 528f84b12d6de5a4eb18424b4db5b874bb2ed240 /src/jit/assertionprop.cpp | |
parent | bcd4c0c7ff141f854c1c3727f9a5cf45ea3efd43 (diff) | |
download | coreclr-cbaf04647bf4fddaeefb35af024b4d099ee4c25a.tar.gz coreclr-cbaf04647bf4fddaeefb35af024b4d099ee4c25a.tar.bz2 coreclr-cbaf04647bf4fddaeefb35af024b4d099ee4c25a.zip |
1st Class Struct Block Assignments
Change block ops to assignments, with block nodes (GT_BLK, GT_OBJ and GT_DYN_BLK) as the lhs, and with GT_STORE_* in the backend.
For this initial change, existing behavior is preserved as much as possible, with a few differences in lea generation for SIMD types.
This causes pessimization in some areas; those, as well as the additional opportunities that can be enabled after this change, have all been marked TODO-1stClassStructs.
Diffstat (limited to 'src/jit/assertionprop.cpp')
-rw-r--r-- | src/jit/assertionprop.cpp | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp index fdcf8da48b..3b071290c2 100644 --- a/src/jit/assertionprop.cpp +++ b/src/jit/assertionprop.cpp @@ -2049,6 +2049,13 @@ void Compiler::optAssertionGen(GenTreePtr tree) } break; + case GT_OBJ: + case GT_BLK: + case GT_DYN_BLK: + // TODO-1stClassStructs: These should always be considered to create a non-null + // assertion, but previously, when these indirections were implicit due to a block + // copy or init, they were not being considered to do so. + break; case GT_IND: // TODO-1stClassStructs: All indirections should be considered to create a non-null // assertion, but previously, when these indirections were implicit due to a block @@ -3414,6 +3421,26 @@ GenTreePtr Compiler::optAssertionProp_Ind(ASSERT_VALARG_TP assertions, const Gen { assert(tree->OperIsIndir()); + // TODO-1stClassStructs: All indirections should be handled here, but + // previously, when these indirections were GT_OBJ, or implicit due to a block + // copy or init, they were not being handled. + bool propagateIndir = true; + if (tree->TypeGet() == TYP_STRUCT) + { + if (tree->OperIsBlk()) + { + return nullptr; + } + else + { + GenTree* parent = tree->gtGetParent(nullptr); + if ((parent != nullptr) && parent->OperIsBlkOp()) + { + return nullptr; + } + } + } + if (!(tree->gtFlags & GTF_EXCEPT)) { return nullptr; @@ -3851,6 +3878,9 @@ GenTreePtr Compiler::optAssertionProp(ASSERT_VALARG_TP assertions, const GenTree case GT_LCL_VAR: return optAssertionProp_LclVar(assertions, tree, stmt); + case GT_OBJ: + case GT_BLK: + case GT_DYN_BLK: case GT_IND: case GT_NULLCHECK: return optAssertionProp_Ind(assertions, tree, stmt); @@ -4815,11 +4845,8 @@ void Compiler::optVnNonNullPropCurStmt(BasicBlock* block, GenTreePtr stmt, GenTr { newTree = optNonNullAssertionProp_Call(empty, tree, stmt); } - else if (tree->OperGet() == GT_IND || tree->OperGet() == GT_NULLCHECK) + else if (tree->OperIsIndir()) { - // TODO-1stClassStructs: All indirections should be handled here, but - // previously, when these indirections were GT_OBJ, or implicit due to a block - // copy or init, they were not being handled. newTree = optAssertionProp_Ind(empty, tree, stmt); } if (newTree) |