From b605c804235970dbb71e8657dde9cb651588f941 Mon Sep 17 00:00:00 2001 From: Hyeongseok Oh Date: Mon, 10 Jul 2017 19:29:16 +0900 Subject: [PATCH] [RyuJIT/ARM32] Fix register allocation for split GT_FIELD_LIST struct To fix register allocation for split GT_FIELD_LIST struct, set source register for each node of GT_FIELD_LIST --- src/jit/lsraarmarch.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/jit/lsraarmarch.cpp b/src/jit/lsraarmarch.cpp index 7080614..a42ef4b 100644 --- a/src/jit/lsraarmarch.cpp +++ b/src/jit/lsraarmarch.cpp @@ -824,6 +824,18 @@ void Lowering::TreeNodeInfoInitPutArgSplit(GenTreePutArgSplit* argNode, TreeNode // argNode->gtLsraInfo.srcCount = argInfo->numRegs + argInfo->numSlots; + // To avoid redundant moves, have the argument operand computed in the + // register in which the argument is passed to the call. + GenTreeFieldList* fieldListPtr = putArgChild->AsFieldList(); + for (unsigned idx = 0; fieldListPtr != nullptr; fieldListPtr = fieldListPtr->Rest(), idx++) + { + if (idx < argInfo->numRegs) + { + GenTreePtr node = fieldListPtr->gtGetOp1(); + node->gtLsraInfo.setSrcCandidates(m_lsra, genRegMask((regNumber)((unsigned)argReg + idx))); + } + } + putArgChild->SetContained(); } else -- 2.7.4