Optimize SIMD codegen for (in)equality check against zero that produces bool result.#7367
Conversation
|
@dotnet-bot test Windows_NT jitstressregs1 |
|
@CarolEidt - Please review this. |
|
Nice. LGTM. In reply to: 249947330 [](ancestors = 249947330) |
|
|
Optimize SIMD codegen for (in)equality check against zero that produces bool result. Commit migrated from dotnet/coreclr@f7b15f7
As per Intel TechEmPower benchmark analysis, Kestrel.Internal.Infrastructure.MemoryPoolIterator.Seek() is one of the hot methods. This method uses equality against Vector.Zero
That is, SIMD API used is
bool Vector<T>.Equals(Vector<T> v)Right now RyuJIT backend is generating the following
RyuJIT backend should be able to detect equality check against is Vector.Zero and generate the following optimal code
Similarly for in-equality check against zero, we can generate
ptest ymm0, ymm0
setnz dil
movzx edx, dil
Fix #7358