diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index 87d0912b66445e..12f908f9d65457 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -10760,6 +10760,12 @@ GenTree* Compiler::fgOptimizeHWIntrinsic(GenTreeHWIntrinsic* node) break; } + // Must be working with the same types of vectors. + if (hwop1->TypeGet() != node->TypeGet()) + { + break; + } + if (toScalar != nullptr) { DEBUG_DESTROY_NODE(toScalar); diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_91062/Runtime_91062.cs b/src/tests/JIT/Regression/JitBlue/Runtime_91062/Runtime_91062.cs new file mode 100644 index 00000000000000..8886bd2044ab04 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_91062/Runtime_91062.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license.aa + +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; +using System.Numerics; +using Xunit; + +public class Runtime_91062 +{ + [Fact] + public static void TestEntryPoint() + { + Foo(default, default); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static Vector2 Foo(Vector128 v1, Vector128 v2) + { + return Vector2.Lerp(default, default, Vector128.Dot(v1, v2)); + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_91062/Runtime_91062.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_91062/Runtime_91062.csproj new file mode 100644 index 00000000000000..de6d5e08882e86 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_91062/Runtime_91062.csproj @@ -0,0 +1,8 @@ + + + True + + + + +