[RyuJIT/ARMARCH] TreeNodeInfoInit for GT_NULLCHECK
authorHyeongseok Oh <hseok82.oh@samsung.com>
Wed, 30 Aug 2017 02:06:45 +0000 (11:06 +0900)
committerHyeongseok Oh <hseok82.oh@samsung.com>
Wed, 30 Aug 2017 02:06:45 +0000 (11:06 +0900)
Change dstCount, internalcount for GT_NULLCHECK on ARM32
Remove calling TreeNodeInfoInitIndir() for GT_NULLCHECK on ARM32, ARM64

src/jit/codegenarmarch.cpp
src/jit/lsraarm.cpp
src/jit/lsraarm64.cpp

index bf83e13..3c94aef 100644 (file)
@@ -1272,7 +1272,7 @@ void CodeGen::genCodeForNullCheck(GenTreeOp* tree)
 #ifdef _TARGET_ARM64_
     regNumber targetReg = REG_ZR;
 #else
-    regNumber targetReg = tree->gtRegNum;
+    regNumber targetReg = tree->GetSingleTempReg();
 #endif
 
     getEmitter()->emitIns_R_R_I(INS_ldr, EA_4BYTE, targetReg, addrReg, 0);
index 4912705..167d4ab 100644 (file)
@@ -664,13 +664,10 @@ void LinearScan::TreeNodeInfoInit(GenTree* tree)
         break;
 
         case GT_NULLCHECK:
-            // Although NULLCHECK is defined as GTK_NOVALUE, it requires a target
-            // register on ARM, as it is implemented as a load.
-            info->dstCount      = 1;
-            info->srcCount      = 1;
-            info->isLocalDefUse = true;
-            // null check is an indirection on an addr
-            TreeNodeInfoInitIndir(tree->AsIndir());
+            // It requires a internal register on ARM, as it is implemented as a load
+            assert(info->dstCount == 0);
+            info->srcCount         = 1;
+            info->internalIntCount = 1;
             break;
 
         case GT_IND:
index 66a4519..2c7313c 100644 (file)
@@ -630,12 +630,10 @@ void LinearScan::TreeNodeInfoInit(GenTree* tree)
         break;
 
         case GT_NULLCHECK:
-            // Unlike ARM, ARM64 implements NULLCHECK as a load to REG_ZR, so no target register
+            // Unlike ARM, ARM64 implements NULLCHECK as a load to REG_ZR, so no internal register
             // is required, and it is not a localDefUse.
             assert(info->dstCount == 0);
             info->srcCount = 1;
-            // null check is an indirection on an addr
-            TreeNodeInfoInitIndir(tree->AsIndir());
             break;
 
         case GT_IND: