Merge pull request dotnet/coreclr#6572 from JosephTremoulet/starg
authorJoseph Tremoulet <JCTremoulet@gmail.com>
Fri, 5 Aug 2016 00:31:03 +0000 (20:31 -0400)
committerGitHub <noreply@github.com>
Fri, 5 Aug 2016 00:31:03 +0000 (20:31 -0400)
Allow inlining when inlinee has `starg`

Commit migrated from https://github.com/dotnet/coreclr/commit/8505731804b4712102326d87df21f232166d178d

1  2 
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/importer.cpp

@@@ -22401,13 -22383,12 +22383,14 @@@ GenTreePtr      Compiler::fgInlinePrepe
  
                  if (argSingleUseNode &&
                      !(argSingleUseNode->gtFlags & GTF_VAR_CLONED) &&
-                     !inlArgInfo[argNum].argHasLdargaOp)
+                     !inlArgInfo[argNum].argHasLdargaOp &&
+                     !inlArgInfo[argNum].argHasStargOp)
                  {
 -                    /* Change the temp in-place to the actual argument */
 -
 -                    argSingleUseNode->CopyFrom(inlArgInfo[argNum].argNode, this);
 +                    // Change the temp in-place to the actual argument.
 +                    // We currently do not support this for struct arguments, so it must not be a GT_OBJ.
 +                    GenTree* argNode = inlArgInfo[argNum].argNode;
 +                    assert(argNode->gtOper != GT_OBJ);
 +                    argSingleUseNode->CopyFrom(argNode, this);
                      continue;
                  }
                  else
Simple merge