Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move memset/memcpy helpers to managed impl #98623

Merged
merged 48 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
508eb9c
Remove JIT_MemSet/JIT_MemCpy
EgorBo Feb 18, 2024
32ec60e
Add a test
EgorBo Feb 18, 2024
0d4f4f4
Address feedback
EgorBo Feb 18, 2024
321bb14
Address feedback
EgorBo Feb 18, 2024
4904b4b
Address feedback
EgorBo Feb 18, 2024
1573925
Address feedback
EgorBo Feb 18, 2024
cbcfaf4
Copy Fill's impl
EgorBo Feb 18, 2024
63c893c
Address feedback + clean up
EgorBo Feb 18, 2024
36e9c5f
Fix comments
EgorBo Feb 18, 2024
4bc7578
Fix regressions
EgorBo Feb 18, 2024
4ed5a3e
Merge branch 'main' of github.com:dotnet/runtime into remove-jit-memset
EgorBo Feb 18, 2024
4158403
CI test
EgorBo Feb 19, 2024
45caa7e
Merge branch 'main' of github.com:dotnet/runtime into remove-jit-memset
EgorBo Feb 21, 2024
4d7991b
Update src/libraries/System.Private.CoreLib/src/System/SpanHelpers.cs
EgorBo Feb 21, 2024
0677bc1
Merge branch 'remove-jit-memset' of github.com:EgorBo/runtime-1 into …
EgorBo Feb 21, 2024
a76a590
Address feedback
EgorBo Feb 21, 2024
e896a47
revert jit change
EgorBo Feb 21, 2024
a8d3b98
Update issues.targets
EgorBo Feb 21, 2024
974a361
Clean up
EgorBo Feb 21, 2024
23a3613
Merge branch 'main' into remove-jit-memset
EgorBo Feb 21, 2024
2e00789
Add native memset helper
EgorBo Feb 21, 2024
71954f4
Merge branch 'main' of github.com:dotnet/runtime into remove-jit-memset
EgorBo Feb 21, 2024
c87288d
Update src/coreclr/inc/corinfo.h
EgorBo Feb 21, 2024
f06ed61
Address feedback
EgorBo Feb 21, 2024
1550a0d
Merge branch 'main' into remove-jit-memset
EgorBo Feb 21, 2024
96fa40b
Better impl for ClearWithoutReferences
EgorBo Feb 21, 2024
8dbe6d7
Fix build
EgorBo Feb 21, 2024
4095d92
Merge branch 'remove-jit-memset' of github.com:EgorBo/runtime-1 into …
EgorBo Feb 21, 2024
86c25d7
Remove whitespace
EgorBo Feb 21, 2024
2840964
Merge branch 'main' of github.com:dotnet/runtime into remove-jit-memset
EgorBo Feb 23, 2024
7d4ff29
Clean up
EgorBo Feb 23, 2024
f10915b
Add file
EgorBo Feb 23, 2024
6dfe8c0
Fix unix build
EgorBo Feb 23, 2024
ffce47e
Improve Unsafe.InitBlock
EgorBo Feb 23, 2024
2dd0c11
Tier up helpers
EgorBo Feb 23, 2024
7ce4cb7
Address feedback
EgorBo Feb 24, 2024
54639a1
Clean up
EgorBo Feb 24, 2024
d8da20a
Fix StackOverflow in Mono
EgorBo Feb 24, 2024
ec82a4d
Fix IL test
EgorBo Feb 24, 2024
f3c0141
Address feedback
EgorBo Feb 24, 2024
6e83d82
Add zero check to memmove (in case of invalid pointers with len=0)
EgorBo Feb 24, 2024
1bbaa3d
Clean up symbol name
EgorBo Feb 24, 2024
a621ad2
Add a test
EgorBo Feb 24, 2024
6283cf2
More clean up (in jit)
EgorBo Feb 24, 2024
c497ca1
Fix NAOT
EgorBo Feb 24, 2024
0a72fab
Update src/libraries/System.Private.CoreLib/src/System/SpanHelpers.By…
EgorBo Feb 25, 2024
8aa3377
Address feedback
EgorBo Feb 25, 2024
f5e0662
Update guide-for-porting.md
EgorBo Feb 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions docs/design/coreclr/botr/guide-for-porting.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,6 @@ Here is an annotated list of the stubs implemented for Unix on Arm64.
Today use of this feature on Unix requires hand-written IL. On Windows
this feature is commonly used by C++/CLI

3. EH Correctness. Some helpers are written in assembly to provide well known
locations for NullReferenceExceptions to be generated out of a SIGSEGV
signal.

1. `JIT_MemSet`, and `JIT_MemCpy` have this requirement

#### cgencpu.h

This header is included by various code in the VM directory. It provides a large
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static unsafe void CopyImpl(Array sourceArray, int sourceIndex, Array de
if (pMT->ContainsGCPointers)
Buffer.BulkMoveWithWriteBarrier(ref dst, ref src, byteCount);
else
Buffer.Memmove(ref dst, ref src, byteCount);
SpanHelpers.Memmove(ref dst, ref src, byteCount);

// GC.KeepAlive(sourceArray) not required. pMT kept alive via sourceArray
return;
Expand Down Expand Up @@ -184,7 +184,7 @@ private static unsafe void CopyImplUnBoxEachElement(Array sourceArray, int sourc
}
else
{
Buffer.Memmove(ref dest, ref obj.GetRawData(), destSize);
SpanHelpers.Memmove(ref dest, ref obj.GetRawData(), destSize);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected internal unsafe object MemberwiseClone()
if (RuntimeHelpers.GetMethodTable(clone)->ContainsGCPointers)
Buffer.BulkMoveWithWriteBarrier(ref dst, ref src, byteCount);
else
Buffer.Memmove(ref dst, ref src, byteCount);
SpanHelpers.Memmove(ref dst, ref src, byteCount);

return clone;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public static unsafe void StructureToPtr(object structure, IntPtr ptr, bool fDel
}
else
{
Buffer.Memmove(ref *(byte*)ptr, ref structure.GetRawData(), size);
SpanHelpers.Memmove(ref *(byte*)ptr, ref structure.GetRawData(), size);
}
}

Expand All @@ -291,7 +291,7 @@ private static unsafe void PtrToStructureHelper(IntPtr ptr, object structure, bo
}
else
{
Buffer.Memmove(ref structure.GetRawData(), ref *(byte*)ptr, size);
SpanHelpers.Memmove(ref structure.GetRawData(), ref *(byte*)ptr, size);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ internal static unsafe void InternalCopy(string src, IntPtr dest, int len)
{
if (len != 0)
{
Buffer.Memmove(ref *(byte*)dest, ref Unsafe.As<char, byte>(ref src.GetRawStringData()), (nuint)len);
SpanHelpers.Memmove(ref *(byte*)dest, ref Unsafe.As<char, byte>(ref src.GetRawStringData()), (nuint)len);
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ internal static unsafe IntPtr ConvertToNative(int flags, string strManaged, IntP
// + 1 for the null character from the user. + 1 for the null character we put in.
pbNativeBuffer = (byte*)Marshal.AllocCoTaskMem(nb + 2);

Buffer.Memmove(ref *pbNativeBuffer, ref MemoryMarshal.GetArrayDataReference(bytes), (nuint)nb);
SpanHelpers.Memmove(ref *pbNativeBuffer, ref MemoryMarshal.GetArrayDataReference(bytes), (nuint)nb);
}
}

Expand Down Expand Up @@ -360,7 +360,7 @@ internal static unsafe IntPtr ConvertToNative(string strManaged, bool fBestFit,

Debug.Assert(nbytesused >= 0 && nbytesused < nbytes, "Insufficient buffer allocated in VBByValStrMarshaler.ConvertToNative");

Buffer.Memmove(ref *pNative, ref MemoryMarshal.GetArrayDataReference(bytes), (nuint)nbytesused);
SpanHelpers.Memmove(ref *pNative, ref MemoryMarshal.GetArrayDataReference(bytes), (nuint)nbytesused);

pNative[nbytesused] = 0;
*pLength = nbytesused;
Expand Down Expand Up @@ -409,7 +409,7 @@ internal static unsafe IntPtr ConvertToNative(int flags, string strManaged)
IntPtr bstr = Marshal.AllocBSTRByteLen(length);
if (bytes != null)
{
Buffer.Memmove(ref *(byte*)bstr, ref MemoryMarshal.GetArrayDataReference(bytes), length);
SpanHelpers.Memmove(ref *(byte*)bstr, ref MemoryMarshal.GetArrayDataReference(bytes), length);
}

return bstr;
Expand Down Expand Up @@ -1484,7 +1484,7 @@ internal static unsafe void FmtClassUpdateNativeInternal(object obj, byte* pNati
}
else
{
Buffer.Memmove(ref *pNative, ref obj.GetRawData(), size);
SpanHelpers.Memmove(ref *pNative, ref obj.GetRawData(), size);
}
}

Expand All @@ -1503,7 +1503,7 @@ internal static unsafe void FmtClassUpdateCLRInternal(object obj, byte* pNative)
}
else
{
Buffer.Memmove(ref obj.GetRawData(), ref *pNative, size);
SpanHelpers.Memmove(ref obj.GetRawData(), ref *pNative, size);
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,10 @@ enum CorInfoHelpFunc
CORINFO_HELP_INIT_PINVOKE_FRAME, // initialize an inlined PInvoke Frame for the JIT-compiler

CORINFO_HELP_MEMSET, // Init block of memory
CORINFO_HELP_MEMZERO, // Init block of memory with zeroes
CORINFO_HELP_MEMCPY, // Copy block of memory
CORINFO_HELP_NATIVE_MEMSET, // Init block of memory using native memset (not safe for pDst being null,
// not safe for unbounded size, does not trigger GC)

CORINFO_HELP_RUNTIMEHANDLE_METHOD, // determine a type/field/method handle at run-time
CORINFO_HELP_RUNTIMEHANDLE_METHOD_LOG, // determine a type/field/method handle at run-time, with IBC logging
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ typedef const GUID *LPCGUID;
#define GUID_DEFINED
#endif // !GUID_DEFINED

constexpr GUID JITEEVersionIdentifier = { /* 1f30d12b-38f1-4f1e-a08a-831def882aa4 */
0x1f30d12b,
0x38f1,
0x4f1e,
{0xa0, 0x8a, 0x83, 0x1d, 0xef, 0x88, 0x2a, 0xa4}
constexpr GUID JITEEVersionIdentifier = { /* 86eab154-5d93-4fad-bc07-e94fd9268b70 */
0x86eab154,
0x5d93,
0x4fad,
{0xbc, 0x07, 0xe9, 0x4f, 0xd9, 0x26, 0x8b, 0x70}
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
11 changes: 4 additions & 7 deletions src/coreclr/inc/jithelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,10 @@
DYNAMICJITHELPER(CORINFO_HELP_INIT_PINVOKE_FRAME, NULL, CORINFO_HELP_SIG_REG_ONLY)
#endif

#ifdef TARGET_X86
JITHELPER(CORINFO_HELP_MEMSET, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
JITHELPER(CORINFO_HELP_MEMCPY, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
#else
JITHELPER(CORINFO_HELP_MEMSET, JIT_MemSet, CORINFO_HELP_SIG_REG_ONLY)
JITHELPER(CORINFO_HELP_MEMCPY, JIT_MemCpy, CORINFO_HELP_SIG_REG_ONLY)
#endif
DYNAMICJITHELPER(CORINFO_HELP_MEMSET, NULL, CORINFO_HELP_SIG_REG_ONLY)
DYNAMICJITHELPER(CORINFO_HELP_MEMZERO, NULL, CORINFO_HELP_SIG_REG_ONLY)
DYNAMICJITHELPER(CORINFO_HELP_MEMCPY, NULL, CORINFO_HELP_SIG_REG_ONLY)
JITHELPER(CORINFO_HELP_NATIVE_MEMSET, Jit_NativeMemSet, CORINFO_HELP_SIG_REG_ONLY)

// Generics
JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_METHOD, JIT_GenericHandleMethod, CORINFO_HELP_SIG_REG_ONLY)
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/inc/readytorun.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// If you update this, ensure you run `git grep MINIMUM_READYTORUN_MAJOR_VERSION`
// and handle pending work.
#define READYTORUN_MAJOR_VERSION 0x0009
#define READYTORUN_MINOR_VERSION 0x0001
#define READYTORUN_MINOR_VERSION 0x0002

#define MINIMUM_READYTORUN_MAJOR_VERSION 0x009

Expand All @@ -33,6 +33,8 @@
// R2R Version 8.0 Changes the alignment of the Int128 type
// R2R Version 9.0 adds support for the Vector512 type
// R2R Version 9.1 adds new helpers to allocate objects on frozen segments
// R2R Version 9.2 adds MemZero and NativeMemSet helpers


struct READYTORUN_CORE_HEADER
{
Expand Down Expand Up @@ -325,7 +327,9 @@ enum ReadyToRunHelper
READYTORUN_HELPER_Stelem_Ref = 0x38,
READYTORUN_HELPER_Ldelema_Ref = 0x39,

READYTORUN_HELPER_MemSet = 0x40,
READYTORUN_HELPER_MemZero = 0x3E,
READYTORUN_HELPER_MemSet = 0x3F,
READYTORUN_HELPER_NativeMemSet = 0x40,
READYTORUN_HELPER_MemCpy = 0x41,

// PInvoke helpers
Expand Down Expand Up @@ -441,10 +445,6 @@ enum ReadyToRunHelper
READYTORUN_HELPER_StackProbe = 0x111,

READYTORUN_HELPER_GetCurrentManagedThreadId = 0x112,

// Array helpers for use with native ints
READYTORUN_HELPER_Stelem_Ref_I = 0x113,
READYTORUN_HELPER_Ldelema_Ref_I = 0x114,
};

#include "readytoruninstructionset.h"
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/inc/readytorunhelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ HELPER(READYTORUN_HELPER_Stelem_Ref, CORINFO_HELP_ARRADDR_ST,
HELPER(READYTORUN_HELPER_Ldelema_Ref, CORINFO_HELP_LDELEMA_REF, )

HELPER(READYTORUN_HELPER_MemSet, CORINFO_HELP_MEMSET, )
HELPER(READYTORUN_HELPER_MemZero, CORINFO_HELP_MEMZERO, )
HELPER(READYTORUN_HELPER_NativeMemSet, CORINFO_HELP_NATIVE_MEMSET, )
HELPER(READYTORUN_HELPER_MemCpy, CORINFO_HELP_MEMCPY, )

HELPER(READYTORUN_HELPER_LogMethodEnter, CORINFO_HELP_BBT_FCN_ENTER, )
Expand Down
4 changes: 3 additions & 1 deletion src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8403,7 +8403,9 @@ void CodeGen::genPoisonFrame(regMaskTP regLiveIn)
GetEmitter()->emitIns_R_S(INS_lea, EA_PTRSIZE, REG_ARG_0, (int)varNum, 0);
instGen_Set_Reg_To_Imm(EA_4BYTE, REG_ARG_1, static_cast<char>(poisonVal));
instGen_Set_Reg_To_Imm(EA_PTRSIZE, REG_ARG_2, size);
genEmitHelperCall(CORINFO_HELP_MEMSET, 0, EA_UNKNOWN);

// Call non-managed memset
genEmitHelperCall(CORINFO_HELP_NATIVE_MEMSET, 0, EA_UNKNOWN);
// May kill REG_SCRATCH, so we need to reload it.
hasPoisonImm = false;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/fgbasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed
case NI_System_SpanHelpers_ClearWithoutReferences:
case NI_System_SpanHelpers_Fill:
case NI_System_SpanHelpers_SequenceEqual:
case NI_System_Buffer_Memmove:
case NI_System_SpanHelpers_Memmove:
{
if (FgStack::IsConstArgument(pushedStack.Top(), impInlineInfo))
{
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/jit/fgprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ class ValueHistogramProbeVisitor final : public GenTreeVisitor<ValueHistogramPro
if (node->IsCall() && node->AsCall()->IsSpecialIntrinsic())
{
const NamedIntrinsic ni = m_compiler->lookupNamedIntrinsic(node->AsCall()->gtCallMethHnd);
if ((ni == NI_System_Buffer_Memmove) || (ni == NI_System_SpanHelpers_SequenceEqual))
if ((ni == NI_System_SpanHelpers_Memmove) || (ni == NI_System_SpanHelpers_SequenceEqual))
{
m_functor(m_compiler, node);
}
Expand Down Expand Up @@ -2274,7 +2274,7 @@ class ValueHistogramProbeInserter
return;
}

assert(node->AsCall()->IsSpecialIntrinsic(compiler, NI_System_Buffer_Memmove) ||
assert(node->AsCall()->IsSpecialIntrinsic(compiler, NI_System_SpanHelpers_Memmove) ||
node->AsCall()->IsSpecialIntrinsic(compiler, NI_System_SpanHelpers_SequenceEqual));

const ICorJitInfo::PgoInstrumentationSchema& countEntry = m_schema[*m_currentSchemaIndex];
Expand Down Expand Up @@ -2540,7 +2540,7 @@ PhaseStatus Compiler::fgPrepareToInstrumentMethod()
// These are marked as [Intrinsic] only to be handled (unrolled) for constant inputs.
// In other cases they have large managed implementations we want to profile.
case NI_System_String_Equals:
case NI_System_Buffer_Memmove:
case NI_System_SpanHelpers_Memmove:
case NI_System_MemoryExtensions_Equals:
case NI_System_MemoryExtensions_SequenceEqual:
case NI_System_MemoryExtensions_StartsWith:
Expand Down
30 changes: 23 additions & 7 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10295,9 +10295,9 @@ void Compiler::impImportBlockCode(BasicBlock* block)
}
#endif

op3 = impPopStack().val; // Size
op2 = impPopStack().val; // Value / Src addr
op1 = impPopStack().val; // Dst addr
op3 = gtFoldExpr(impPopStack().val); // Size
op2 = gtFoldExpr(impPopStack().val); // Value / Src addr
op1 = impPopStack().val; // Dst addr

if (op3->IsCnsIntOrI())
{
Expand Down Expand Up @@ -10343,18 +10343,34 @@ void Compiler::impImportBlockCode(BasicBlock* block)
// TODO: enable for X86 as well, it currently doesn't support memset/memcpy helpers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x86 supports memset/memcpy helpers now (this can be a follow up change)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's part of a follow up PR because it involves removal of GT_STORE_DYN_BLK op, definitely didn't want to do it as part of this PR

// Then, get rid of GT_STORE_DYN_BLK entirely.
#ifndef TARGET_X86
const unsigned helper = opcode == CEE_INITBLK ? CORINFO_HELP_MEMSET : CORINFO_HELP_MEMCPY;
GenTreeCall* call;
if (opcode == CEE_INITBLK)
{
// value is zero -> memzero, otherwise -> memset
if (op2->IsIntegralConst(0))
{
call = gtNewHelperCallNode(CORINFO_HELP_MEMZERO, TYP_VOID, op1, op3);
}
else
{
call = gtNewHelperCallNode(CORINFO_HELP_MEMSET, TYP_VOID, op1, op2, op3);
}
}
else
{
call = gtNewHelperCallNode(CORINFO_HELP_MEMCPY, TYP_VOID, op1, op2, op3);
}

if (isVolatile)
{
// Wrap with memory barriers: full-barrier + call + load-barrier
impAppendTree(gtNewMemoryBarrier(), CHECK_SPILL_ALL, impCurStmtDI);
impAppendTree(gtNewHelperCallNode(helper, TYP_VOID, op1, op2, op3), CHECK_SPILL_ALL,
impCurStmtDI);
impAppendTree(call, CHECK_SPILL_ALL, impCurStmtDI);
op1 = gtNewMemoryBarrier(true);
}
else
{
op1 = gtNewHelperCallNode(helper, TYP_VOID, op1, op2, op3);
op1 = call;
}
#else
if (opcode == CEE_INITBLK)
Expand Down
19 changes: 8 additions & 11 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ var_types Compiler::impImportCall(OPCODE opcode,
impAppendTree(call, verCurrentState.esStackDepth - 1, impCurStmtDI);
}
else if (JitConfig.JitProfileValues() && call->IsCall() &&
call->AsCall()->IsSpecialIntrinsic(this, NI_System_Buffer_Memmove))
call->AsCall()->IsSpecialIntrinsic(this, NI_System_SpanHelpers_Memmove))
{
if (opts.IsOptimizedWithProfile())
{
Expand Down Expand Up @@ -1555,7 +1555,7 @@ GenTree* Compiler::impDuplicateWithProfiledArg(GenTreeCall* call, IL_OFFSET ilOf
unsigned argNum = 0;
ssize_t minValue = 0;
ssize_t maxValue = 0;
if (call->IsSpecialIntrinsic(this, NI_System_Buffer_Memmove))
if (call->IsSpecialIntrinsic(this, NI_System_SpanHelpers_Memmove))
{
// dst(0), src(1), len(2)
argNum = 2;
Expand Down Expand Up @@ -2761,7 +2761,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
betterToExpand = true;
break;

case NI_System_Buffer_Memmove:
case NI_System_SpanHelpers_Memmove:
case NI_System_SpanHelpers_SequenceEqual:
// We're going to instrument these
betterToExpand = opts.IsInstrumented();
Expand Down Expand Up @@ -3983,7 +3983,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
case NI_System_Text_UTF8Encoding_UTF8EncodingSealed_ReadUtf8:
case NI_System_SpanHelpers_SequenceEqual:
case NI_System_SpanHelpers_ClearWithoutReferences:
case NI_System_Buffer_Memmove:
case NI_System_SpanHelpers_Memmove:
{
if (sig->sigInst.methInstCount == 0)
{
Expand Down Expand Up @@ -8874,13 +8874,6 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method)
result = NI_System_BitConverter_Int64BitsToDouble;
}
}
else if (strcmp(className, "Buffer") == 0)
{
if (strcmp(methodName, "Memmove") == 0)
{
result = NI_System_Buffer_Memmove;
}
}
break;
}

Expand Down Expand Up @@ -9040,6 +9033,10 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method)
{
result = NI_System_SpanHelpers_ClearWithoutReferences;
}
else if (strcmp(methodName, "Memmove") == 0)
{
result = NI_System_SpanHelpers_Memmove;
}
}
else if (strcmp(className, "String") == 0)
{
Expand Down
Loading
Loading