diff options
author | Pat Gavlin <pgavlin@gmail.com> | 2016-09-22 13:10:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-22 13:10:32 -0700 |
commit | 4dd3965514c9b4316230cbd329fc0b0f84be2a92 (patch) | |
tree | e775d762ddb18ec65bcc5c26b9a04fad52220b02 /src/jit/decomposelongs.cpp | |
parent | 3deaee80d100d7ebe2f20d738e793ccfb20ac98b (diff) | |
parent | 91abd10e5949a1f4d3d49dc36d889ee69009b58f (diff) | |
download | coreclr-4dd3965514c9b4316230cbd329fc0b0f84be2a92.tar.gz coreclr-4dd3965514c9b4316230cbd329fc0b0f84be2a92.tar.bz2 coreclr-4dd3965514c9b4316230cbd329fc0b0f84be2a92.zip |
Merge pull request #7319 from pgavlin/GTLongFieldList
Decompose GT_FIELD_LIST nodes that use a GT_LONG.
Diffstat (limited to 'src/jit/decomposelongs.cpp')
-rw-r--r-- | src/jit/decomposelongs.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/jit/decomposelongs.cpp b/src/jit/decomposelongs.cpp index 31fbafce3b..2f0dfbe6f0 100644 --- a/src/jit/decomposelongs.cpp +++ b/src/jit/decomposelongs.cpp @@ -259,6 +259,37 @@ GenTree* DecomposeLongs::DecomposeNode(GenTree* tree) } } + // If we replaced the argument to a GT_FIELD_LIST element with a GT_LONG node, split that field list + // element into two elements: one for each half of the GT_LONG. + if ((use.Def()->OperGet() == GT_LONG) && !use.IsDummyUse() && (use.User()->OperGet() == GT_FIELD_LIST)) + { + GenTreeOp* value = use.Def()->AsOp(); + Range().Remove(value); + + // The node returned by `use.User()` is the head of the field list. We need to find the actual node that uses + // the `GT_LONG` so that we can split it. + GenTreeFieldList* listNode = use.User()->AsFieldList(); + for (; listNode != nullptr; listNode = listNode->Rest()) + { + if (listNode->Current() == value) + { + break; + } + } + + assert(listNode != nullptr); + GenTree* rest = listNode->gtOp2; + + GenTreeFieldList* loNode = listNode; + loNode->gtOp1 = value->gtOp1; + loNode->gtFieldType = TYP_INT; + + GenTreeFieldList* hiNode = + new (m_compiler, GT_FIELD_LIST) GenTreeFieldList(value->gtOp2, loNode->gtFieldOffset + 4, TYP_INT, loNode); + + hiNode->gtOp2 = rest; + } + #ifdef DEBUG if (m_compiler->verbose) { |