@@ -211,7 +211,7 @@ void DecomposeLongs::DecomposeNode(GenTree** ppTree, Compiler::fgWalkData* data)
211
211
break ;
212
212
213
213
case GT_IND:
214
- NYI ( " GT_IND of TYP_LONG " );
214
+ DecomposeInd (ppTree, data );
215
215
break ;
216
216
217
217
case GT_NOT:
@@ -865,6 +865,39 @@ void DecomposeLongs::DecomposeStoreInd(GenTree** ppTree, Compiler::fgWalkData* d
865
865
}
866
866
867
867
868
+ // ------------------------------------------------------------------------
869
+ // DecomposeInd: Decompose GT_IND.
870
+ //
871
+ // Arguments:
872
+ // tree - the tree to decompose
873
+ //
874
+ // Return Value:
875
+ // None.
876
+ //
877
+ void DecomposeLongs::DecomposeInd (GenTree** ppTree, Compiler::fgWalkData* data)
878
+ {
879
+ GenTreePtr indLow = *ppTree;
880
+ GenTreeStmt* addrStmt = CreateTemporary (&indLow->gtOp .gtOp1 );
881
+ JITDUMP (" [DecomposeInd]: Saving addr tree to a temp var:\n " );
882
+ DISPTREE (addrStmt);
883
+
884
+ // Change the type of lower ind.
885
+ indLow->gtType = TYP_INT;
886
+
887
+ // Create tree of ind(addr+4)
888
+ GenTreePtr addrBase = indLow->gtGetOp1 ();
889
+ GenTreePtr addrBaseHigh = new (m_compiler, GT_LCL_VAR) GenTreeLclVar (GT_LCL_VAR,
890
+ addrBase->TypeGet (), addrBase->AsLclVarCommon ()->GetLclNum (), BAD_IL_OFFSET);
891
+ GenTreePtr addrHigh = new (m_compiler, GT_LEA) GenTreeAddrMode (TYP_REF, addrBaseHigh, nullptr , 0 , genTypeSize (TYP_INT));
892
+ GenTreePtr indHigh = new (m_compiler, GT_IND) GenTreeIndir (GT_IND, TYP_INT, addrHigh, nullptr );
893
+
894
+ // Connect linear links
895
+ SimpleLinkNodeAfter (addrBaseHigh, addrHigh);
896
+ SimpleLinkNodeAfter (addrHigh, indHigh);
897
+
898
+ FinalizeDecomposition (ppTree, data, indLow, indHigh);
899
+ }
900
+
868
901
// ------------------------------------------------------------------------
869
902
// DecomposeNot: Decompose GT_NOT.
870
903
//
0 commit comments