diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index b5eae4a04312eb..d349b21e3ccf46 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -1303,11 +1303,10 @@ var_types Compiler::impImportCall(OPCODE opcode, eeGetCallSiteSig(pResolvedToken->token, pResolvedToken->tokenScope, pResolvedToken->tokenContext, sig); } - typeInfo tiRetVal = verMakeTypeInfo(sig->retType, sig->retTypeClass); - - if (call->IsCall()) + // Sometimes "call" is not a GT_CALL (if we imported an intrinsic that didn't turn into a call) + if (!bIntrinsicImported) { - // Sometimes "call" is not a GT_CALL (if we imported an intrinsic that didn't turn into a call) + assert(call->IsCall()); GenTreeCall* origCall = call->AsCall(); @@ -1423,10 +1422,7 @@ var_types Compiler::impImportCall(OPCODE opcode, impSpillSideEffects(true, CHECK_SPILL_ALL DEBUGARG("non-inline candidate call")); } } - } - if (!bIntrinsicImported) - { //------------------------------------------------------------------------- // /* If the call is of a small type and the callee is managed, the callee will normalize the result @@ -1441,14 +1437,10 @@ var_types Compiler::impImportCall(OPCODE opcode, } } + typeInfo tiRetVal = verMakeTypeInfo(sig->retType, sig->retTypeClass); impPushOnStack(call, tiRetVal); } - // VSD functions get a new call target each time we getCallInfo, so clear the cache. - // Also, the call info cache for CALLI instructions is largely incomplete, so clear it out. - // if ( (opcode == CEE_CALLI) || (callInfoCache.fetchCallInfo().kind == CORINFO_VIRTUALCALL_STUB)) - // callInfoCache.uncacheCallInfo(); - return callRetTyp; } #ifdef _PREFAST_ diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_96461/Runtime_96461.cs b/src/tests/JIT/Regression/JitBlue/Runtime_96461/Runtime_96461.cs new file mode 100644 index 00000000000000..155c88b89c796b --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_96461/Runtime_96461.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; +using Xunit; + +public class Runtime_96461 +{ + [Fact] + public static int TestEntryPoint() + { + Vector128 result = Unsafe.BitCast, Vector128>(V()); + return result[0]; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static Vector128 V() => Vector128.Create(100); +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_96461/Runtime_96461.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_96461/Runtime_96461.csproj new file mode 100644 index 00000000000000..6c2e6c34ba4034 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_96461/Runtime_96461.csproj @@ -0,0 +1,10 @@ + + + True + None + true + + + + + \ No newline at end of file