From 6f97a03ac99ea21c8f6089051bd761f04de3394c Mon Sep 17 00:00:00 2001 From: Hyeongseok Oh Date: Thu, 1 Jun 2017 10:19:16 +0900 Subject: [PATCH] [RyuJIT/ARM32] Skip argTable info assignment for split struct when remorphing - Skip argTable no. of register & stack slot assignment for split struct when remorphing - Modify assertion check condition for structs morphed to GT_FIELD_LIST --- src/jit/compiler.h | 2 +- src/jit/morph.cpp | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/jit/compiler.h b/src/jit/compiler.h index d438862..0de222a 100644 --- a/src/jit/compiler.h +++ b/src/jit/compiler.h @@ -1345,7 +1345,7 @@ public: void RemorphStkArg(unsigned argNum, GenTreePtr node, GenTreePtr parent, unsigned numSlots, unsigned alignment); - void SplitArg(unsigned argNum, unsigned numRegs, unsigned numSlots); + void SplitArg(unsigned argNum, unsigned numRegs, unsigned numSlots, bool isReMorph); void EvalToTmp(unsigned argNum, unsigned tmpNum, GenTreePtr newNode); diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index b8c269c..e1d40b9 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -1367,7 +1367,7 @@ void fgArgInfo::RemorphStkArg( nextSlotNum += numSlots; } -void fgArgInfo::SplitArg(unsigned argNum, unsigned numRegs, unsigned numSlots) +void fgArgInfo::SplitArg(unsigned argNum, unsigned numRegs, unsigned numSlots, bool isReMorph) { fgArgTabEntryPtr curArgTabEntry = nullptr; assert(argNum < argCount); @@ -1383,9 +1383,18 @@ void fgArgInfo::SplitArg(unsigned argNum, unsigned numRegs, unsigned numSlots) assert(numRegs > 0); assert(numSlots > 0); - curArgTabEntry->isSplit = true; - curArgTabEntry->numRegs = numRegs; - curArgTabEntry->numSlots = numSlots; + if (isReMorph) + { + assert(curArgTabEntry->isSplit == true); + assert(curArgTabEntry->numRegs == numRegs); + assert(curArgTabEntry->numSlots == numSlots); + } + else + { + curArgTabEntry->isSplit = true; + curArgTabEntry->numRegs = numRegs; + curArgTabEntry->numSlots = numSlots; + } nextSlotNum += numSlots; } @@ -4109,7 +4118,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) assert(varTypeIsStruct(argx)); unsigned numRegsPartial = size - (fltArgRegNum - MAX_FLOAT_REG_ARG); assert((unsigned char)numRegsPartial == numRegsPartial); - call->fgArgInfo->SplitArg(argIndex, numRegsPartial, size - numRegsPartial); + call->fgArgInfo->SplitArg(argIndex, numRegsPartial, size - numRegsPartial, reMorphing); fltArgRegNum = MAX_FLOAT_REG_ARG; } #endif // _TARGET_ARM_ @@ -4138,11 +4147,11 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) NYI_ARM("Struct split between integer registers and stack"); #endif // !LEGACY_BACKEND // This indicates a partial enregistration of a struct type - assert((isStructArg) || argx->OperIsCopyBlkOp() || - (argx->gtOper == GT_COMMA && (args->gtFlags & GTF_ASG))); + assert((isStructArg) || argx->OperIsFieldList() || + argx->OperIsCopyBlkOp() || (argx->gtOper == GT_COMMA && (args->gtFlags & GTF_ASG))); unsigned numRegsPartial = size - (intArgRegNum - MAX_REG_ARG); assert((unsigned char)numRegsPartial == numRegsPartial); - call->fgArgInfo->SplitArg(argIndex, numRegsPartial, size - numRegsPartial); + call->fgArgInfo->SplitArg(argIndex, numRegsPartial, size - numRegsPartial, reMorphing); intArgRegNum = MAX_REG_ARG; fgPtrArgCntCur += size - numRegsPartial; } -- 2.7.4