diff --git a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/Crc32.Vectorized.cs b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/Crc32.Vectorized.cs index 2862e5b6b7e186..f263b6384acfc2 100644 --- a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/Crc32.Vectorized.cs +++ b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/Crc32.Vectorized.cs @@ -29,6 +29,10 @@ private static bool CanBeVectorized(ReadOnlySpan source) => // Computation for Generic Polynomials Using PCLMULQDQ Instruction" in December, 2009. // https://github.com/intel/isa-l/blob/33a2d9484595c2d6516c920ce39a694c144ddf69/crc/crc32_ieee_by4.asm // https://github.com/SixLabors/ImageSharp/blob/f4f689ce67ecbcc35cebddba5aacb603e6d1068a/src/ImageSharp/Formats/Png/Zlib/Crc32.cs#L80 + // + // Marking this as noinline so the JIT doesn't try and inline this and end up not inlining some of the calls it makes. + // + [MethodImpl(MethodImplOptions.NoInlining)] private static uint UpdateVectorized(uint crc, ReadOnlySpan source) { Debug.Assert(CanBeVectorized(source), "source cannot be vectorized."); diff --git a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/Crc64.Vectorized.cs b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/Crc64.Vectorized.cs index c2156bd473347a..98e5a6741bae59 100644 --- a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/Crc64.Vectorized.cs +++ b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/Crc64.Vectorized.cs @@ -43,6 +43,10 @@ private static Vector128 LoadFromSource(ref byte source, nuint elementOff // "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction" in December, 2009 and the // Intel reference implementation. // https://github.com/intel/isa-l/blob/33a2d9484595c2d6516c920ce39a694c144ddf69/crc/crc64_ecma_norm_by8.asm + // + // Marking this as noinline so the JIT doesn't try and inline this and end up not inlining some of the calls it makes. + // + [MethodImpl(MethodImplOptions.NoInlining)] private static ulong UpdateVectorized(ulong crc, ReadOnlySpan source) { Debug.Assert(CanBeVectorized(source), "source cannot be vectorized.");