Remove updating nextSlotNum in remorphing phase
authorHyeongseok Oh <hseok82.oh@samsung.com>
Fri, 2 Jun 2017 03:18:10 +0000 (12:18 +0900)
committerHyeongseok Oh <hseok82.oh@samsung.com>
Fri, 2 Jun 2017 03:18:10 +0000 (12:18 +0900)
Remove updating nextSlotNum in remorphing phase
Remain updating it in remorphing phase for debugging only.

src/jit/compiler.h
src/jit/morph.cpp

index 0de222a..53aa9ad 100644 (file)
@@ -1339,7 +1339,9 @@ public:
                                unsigned   numSlots,
                                unsigned alignment FEATURE_UNIX_AMD64_STRUCT_PASSING_ONLY_ARG(const bool isStruct));
 
+#ifdef DEBUG
     void             RemorphReset();
+#endif
     fgArgTabEntryPtr RemorphRegArg(
         unsigned argNum, GenTreePtr node, GenTreePtr parent, regNumber regNum, unsigned numRegs, unsigned alignment);
 
index 2971c51..33a77d2 100644 (file)
@@ -1207,10 +1207,12 @@ fgArgTabEntryPtr fgArgInfo::AddStkArg(unsigned   argNum,
     return curArgTabEntry;
 }
 
+#ifdef DEBUG
 void fgArgInfo::RemorphReset()
 {
     nextSlotNum = INIT_ARG_STACK_SLOT;
 }
+#endif
 
 fgArgTabEntry* fgArgInfo::RemorphRegArg(
     unsigned argNum, GenTreePtr node, GenTreePtr parent, regNumber regNum, unsigned numRegs, unsigned alignment)
@@ -1319,7 +1321,9 @@ void fgArgInfo::RemorphStkArg(
         }
     }
 
+#ifdef DEBUG
     nextSlotNum = (unsigned)roundUp(nextSlotNum, alignment);
+#endif
 
     assert(curArgTabEntry->argNum == argNum);
     assert(curArgTabEntry->slotNum == nextSlotNum);
@@ -1364,7 +1368,9 @@ void fgArgInfo::RemorphStkArg(
     curArgTabEntry->node = node;
 #endif
 
+#ifdef DEBUG
     nextSlotNum += numSlots;
+#endif
 }
 
 void fgArgInfo::SplitArg(unsigned argNum, unsigned numRegs, unsigned numSlots, bool isReMorph)
@@ -1388,15 +1394,17 @@ void fgArgInfo::SplitArg(unsigned argNum, unsigned numRegs, unsigned numSlots, b
         assert(curArgTabEntry->isSplit == true);
         assert(curArgTabEntry->numRegs == numRegs);
         assert(curArgTabEntry->numSlots == numSlots);
+#ifdef DEBUG
+        nextSlotNum += numSlots;
+#endif
     }
     else
     {
         curArgTabEntry->isSplit  = true;
         curArgTabEntry->numRegs  = numRegs;
         curArgTabEntry->numSlots = numSlots;
+        nextSlotNum += numSlots;
     }
-
-    nextSlotNum += numSlots;
 }
 
 void fgArgInfo::EvalToTmp(unsigned argNum, unsigned tmpNum, GenTreePtr newNode)
@@ -2823,7 +2831,9 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
             fgPtrArgCntCur -= callStkLevel;
         }
         assert(call->fgArgInfo != nullptr);
+#ifndef DEBUG
         call->fgArgInfo->RemorphReset();
+#endif
 
         numArgs = call->fgArgInfo->ArgCount();
     }
@@ -4118,6 +4128,9 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
                             assert(varTypeIsStruct(argx));
                             unsigned numRegsPartial = size - (fltArgRegNum - MAX_FLOAT_REG_ARG);
                             assert((unsigned char)numRegsPartial == numRegsPartial);
+#ifndef DEBUG
+                            if (!reMorphing)
+#endif
                             call->fgArgInfo->SplitArg(argIndex, numRegsPartial, size - numRegsPartial, reMorphing);
                             fltArgRegNum = MAX_FLOAT_REG_ARG;
                         }
@@ -4151,6 +4164,9 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
                                    (argx->gtOper == GT_COMMA && (args->gtFlags & GTF_ASG)));
                             unsigned numRegsPartial = size - (intArgRegNum - MAX_REG_ARG);
                             assert((unsigned char)numRegsPartial == numRegsPartial);
+#ifndef DEBUG
+                            if (!reMorphing)
+#endif
                             call->fgArgInfo->SplitArg(argIndex, numRegsPartial, size - numRegsPartial, reMorphing);
                             intArgRegNum = MAX_REG_ARG;
                             fgPtrArgCntCur += size - numRegsPartial;