diff options
author | Carol Eidt <carol.eidt@microsoft.com> | 2019-03-28 11:23:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-28 11:23:10 -0700 |
commit | 3d4a1d5cea0ae71eed1482990ce6e575049829d8 (patch) | |
tree | fd3ea00fbd67bec2b6f6ec0966ef2bd34ea0c01d /src/jit/gentree.cpp | |
parent | a32f7e6b176fc18973581d48d919112d66e321aa (diff) | |
download | coreclr-3d4a1d5cea0ae71eed1482990ce6e575049829d8.tar.gz coreclr-3d4a1d5cea0ae71eed1482990ce6e575049829d8.tar.bz2 coreclr-3d4a1d5cea0ae71eed1482990ce6e575049829d8.zip |
Struct & SIMD improvements (#22255)
* [WIP] Struct & SIMD improvements
- Enable CSE of struct values when handle is available (and add code to get the handle of HW SIMD types)
- Don't require block nodes for SIMD assignments
- Don't set `GTF_GLOB_REF` on `GT_OBJ` if it is local
- Set `lvRegStruct` on promoted SIMD fields
- Add tests for #19910 (fixed with this PR) and #3539 & #19438 (fixed with #21314)
- Additional cleanup
Fix #19910
Diffstat (limited to 'src/jit/gentree.cpp')
-rw-r--r-- | src/jit/gentree.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp index 2b6520682c..93de32a480 100644 --- a/src/jit/gentree.cpp +++ b/src/jit/gentree.cpp @@ -16529,15 +16529,45 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleIfPresent(GenTree* tree) if (varTypeIsSIMD(tree)) { structHnd = gtGetStructHandleForSIMD(tree->gtType, TYP_FLOAT); +#ifdef FEATURE_HW_INTRINSICS + if (structHnd == NO_CLASS_HANDLE) + { + structHnd = gtGetStructHandleForHWSIMD(tree->gtType, TYP_FLOAT); + } +#endif } else #endif { + // Attempt to find a handle for this expression. + // We can do this for an array element indirection, or for a field indirection. ArrayInfo arrInfo; if (TryGetArrayInfo(tree->AsIndir(), &arrInfo)) { structHnd = EncodeElemType(arrInfo.m_elemType, arrInfo.m_elemStructType); } + else + { + GenTree* addr = tree->AsIndir()->Addr(); + if ((addr->OperGet() == GT_ADD) && addr->gtGetOp2()->OperIs(GT_CNS_INT)) + { + FieldSeqNode* fieldSeq = addr->gtGetOp2()->AsIntCon()->gtFieldSeq; + + if (fieldSeq != nullptr) + { + while (fieldSeq->m_next != nullptr) + { + fieldSeq = fieldSeq->m_next; + } + if (fieldSeq != FieldSeqStore::NotAField() && !fieldSeq->IsPseudoField()) + { + CORINFO_FIELD_HANDLE fieldHnd = fieldSeq->m_fieldHnd; + CorInfoType fieldCorType = info.compCompHnd->getFieldType(fieldHnd, &structHnd); + assert(fieldCorType == CORINFO_TYPE_VALUECLASS); + } + } + } + } } break; #ifdef FEATURE_SIMD |