[RyuJIT/ARM32] Remove unnecessary GT_ADDR and GT_LCL_VAR_ADDR related code
authorJiyoung Yun <jy910.yun@samsung.com>
Fri, 21 Jul 2017 01:43:14 +0000 (10:43 +0900)
committerJiyoung Yun <jy910.yun@samsung.com>
Fri, 21 Jul 2017 01:43:14 +0000 (10:43 +0900)
src/jit/morph.cpp

index 80eb99d..6d25f02 100644 (file)
@@ -4775,20 +4775,13 @@ GenTreePtr Compiler::fgMorphMultiregStructArg(GenTreePtr arg, fgArgTabEntryPtr f
             return arg;
         }
 
-        GenTreeLclVarCommon* lclCommon =
-            arg->OperGet() == GT_ADDR ? arg->gtOp.gtOp1->AsLclVarCommon() : arg->AsLclVarCommon();
+        assert(arg->OperGet() == GT_LCL_VAR);
 
-        // If we didn't change the type of the struct, it means
-        // its classification doesn't support to be passed directly through a
-        // register, so we need to pass a pointer to the destination where
-        // where we copied the struct to.
-        // Make sure this is an addr node.
-        if (arg->OperGet() != GT_ADDR && arg->OperGet() != GT_LCL_VAR_ADDR)
-        {
-            arg = gtNewOperNode(GT_ADDR, TYP_I_IMPL, arg);
-        }
+        // We need to construct a `GT_OBJ` node for the argmuent,
+        // so we need to get the address of the lclVar.
+        GenTreeLclVarCommon* lclCommon = arg->AsLclVarCommon();
 
-        assert(arg->OperGet() == GT_ADDR || arg->OperGet() == GT_LCL_VAR_ADDR);
+        arg = gtNewOperNode(GT_ADDR, TYP_I_IMPL, arg);
 
         // Create an Obj of the temp to use it as a call argument.
         arg = gtNewObjNode(lvaGetStruct(lclCommon->gtLclNum), arg);