Skip to content

Commit

Permalink
Check more patterns for retBuffer. (dotnet#40340)
Browse files Browse the repository at this point in the history
* 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.

* 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.
  • Loading branch information
Sergey Andreenko authored and Jacksondr5 committed Aug 10, 2020
1 parent 713c8f3 commit da2f24d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit da2f24d

Please sign in to comment.