From 9437c5f2f69f84b557b34bb387d3e66869697eac Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Tue, 4 Aug 2020 10:52:09 -0700 Subject: [PATCH 1/2] Check more patterns for retBuffer. We force return buffers containing GC pointers to be on the stack and before we make a copy we check if the return buffer is already on the stack. Fix the check by adding `LCL_VAR_ADDR`, `ADD(LCL_VAR_ADDR, CNST)` patterns. --- src/coreclr/src/jit/morph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp index d5cf8a892395d..61ad9937b0486 100644 --- a/src/coreclr/src/jit/morph.cpp +++ b/src/coreclr/src/jit/morph.cpp @@ -8946,7 +8946,7 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) GenTree* dest = call->gtCallArgs->GetNode(); assert(dest->OperGet() != GT_ARGPLACE); // If it was, we'd be in a remorph, which we've already excluded above. - if (dest->gtType == TYP_BYREF && !(dest->OperGet() == GT_ADDR && dest->AsOp()->gtOp1->OperGet() == GT_LCL_VAR)) + if (dest->TypeIs(TYP_BYREF) && !dest->IsLocalAddrExpr()) { // We'll exempt helper calls from this, assuming that the helper implementation // follows the old convention, and does whatever barrier is required. From 6535ccd5c6a3cad73912d5de2c2a9a5c0a91d1c1 Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Tue, 4 Aug 2020 17:16:01 -0700 Subject: [PATCH 2/2] Clear `EnableExtraSuperPmiQueries` during SPMI replay. It is set during collection for easier test of struct promotion enhancements but it could let to chk/rel diffs if used during replay. --- src/coreclr/scripts/superpmi.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/coreclr/scripts/superpmi.py b/src/coreclr/scripts/superpmi.py index 377af07e0a9d0..12be260c67a91 100755 --- a/src/coreclr/scripts/superpmi.py +++ b/src/coreclr/scripts/superpmi.py @@ -860,7 +860,8 @@ def replay(self): altjit_string = "*" if self.coreclr_args.altjit else "" altjit_flags = [ "-jitoption", "force", "AltJit=" + altjit_string, - "-jitoption", "force", "AltJitNgen=" + altjit_string + "-jitoption", "force", "AltJitNgen=" + altjit_string, + "-jitoption", "force", "EnableExtraSuperPmiQueries=0" ] flags += altjit_flags @@ -1032,8 +1033,10 @@ def replay_with_asm_diffs(self): altjit_flags = [ "-jitoption", "force", "AltJit=" + altjit_string, "-jitoption", "force", "AltJitNgen=" + altjit_string, + "-jitoption", "force", "EnableExtraSuperPmiQueries=0", "-jit2option", "force", "AltJit=" + altjit_string, - "-jit2option", "force", "AltJitNgen=" + altjit_string + "-jit2option", "force", "AltJitNgen=" + altjit_string, + "-jit2option", "force", "EnableExtraSuperPmiQueries=0" ] flags += altjit_flags @@ -1208,7 +1211,8 @@ def replay_with_asm_diffs(self): altjit_string = "*" if self.coreclr_args.altjit else "" altjit_flags = [ "-jitoption", "force", "AltJit=" + altjit_string, - "-jitoption", "force", "AltJitNgen=" + altjit_string + "-jitoption", "force", "AltJitNgen=" + altjit_string, + "-jitoption", "force", "EnableExtraSuperPmiQueries=0" ] async def create_asm(print_prefix, item, self, text_differences, base_asm_location, diff_asm_location):