File tree 5 files changed +50
-2
lines changed
tests/JIT/Regression/JitBlue/Runtime_80239 5 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -8397,6 +8397,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8397
8397
// Get the handle for a SIMD type.
8398
8398
CORINFO_CLASS_HANDLE gtGetStructHandleForSIMD (var_types simdType, CorInfoType simdBaseJitType)
8399
8399
{
8400
+ assert (varTypeIsSIMD (simdType));
8401
+
8400
8402
if (m_simdHandleCache == nullptr )
8401
8403
{
8402
8404
// This may happen if the JIT generates SIMD node on its own, without importing them.
@@ -8463,6 +8465,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8463
8465
CorInfoType simdBaseJitType,
8464
8466
bool isSimdAsHWIntrinsic = false )
8465
8467
{
8468
+ assert (varTypeIsSIMD (simdType));
8469
+
8466
8470
CORINFO_CLASS_HANDLE clsHnd = NO_CLASS_HANDLE;
8467
8471
8468
8472
if (isSimdAsHWIntrinsic)
@@ -8474,6 +8478,14 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8474
8478
clsHnd = gtGetStructHandleForHWSIMD (simdType, simdBaseJitType);
8475
8479
}
8476
8480
8481
+ // Currently there are cases where isSimdAsHWIntrinsic is passed
8482
+ // incorrectly. Fall back to the canonical SIMD handle in that case.
8483
+ // TODO-cleanup: We can probably just always use the canonical handle.
8484
+ if (clsHnd == NO_CLASS_HANDLE)
8485
+ {
8486
+ clsHnd = gtGetCanonicalStructHandleForSIMD (simdType);
8487
+ }
8488
+
8477
8489
return clsHnd;
8478
8490
}
8479
8491
#endif // FEATURE_HW_INTRINSICS
Original file line number Diff line number Diff line change @@ -17598,8 +17598,12 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleIfPresent(GenTree* tree)
17598
17598
#endif // FEATURE_SIMD
17599
17599
#ifdef FEATURE_HW_INTRINSICS
17600
17600
case GT_HWINTRINSIC:
17601
- structHnd = gtGetStructHandleForSimdOrHW(tree->TypeGet(), tree->AsHWIntrinsic()->GetSimdBaseJitType(),
17602
- tree->AsHWIntrinsic()->IsSimdAsHWIntrinsic());
17601
+ if (varTypeIsSIMD(tree))
17602
+ {
17603
+ structHnd =
17604
+ gtGetStructHandleForSimdOrHW(tree->TypeGet(), tree->AsHWIntrinsic()->GetSimdBaseJitType(),
17605
+ tree->AsHWIntrinsic()->IsSimdAsHWIntrinsic());
17606
+ }
17603
17607
break;
17604
17608
#endif
17605
17609
default:
Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ CorInfoType Compiler::getBaseJitTypeFromArgIfNeeded(NamedIntrinsic intrins
88
88
89
89
CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleForHWSIMD (var_types simdType, CorInfoType simdBaseJitType)
90
90
{
91
+ assert (varTypeIsSIMD (simdType));
92
+
91
93
if (m_simdHandleCache == nullptr )
92
94
{
93
95
return NO_CLASS_HANDLE;
Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+
4
+ using System . Numerics ;
5
+ using System . Runtime . CompilerServices ;
6
+
7
+ class Runtime_80239
8
+ {
9
+ static int Main ( string [ ] args )
10
+ {
11
+ Unsafe . SkipInit ( out Vector3 test ) ;
12
+ test . X = 500.0f ;
13
+ Consume ( test ) ;
14
+ return 100 ;
15
+ }
16
+
17
+ [ MethodImpl ( MethodImplOptions . NoInlining ) ]
18
+ private static void Consume ( Vector3 test )
19
+ {
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+ <PropertyGroup >
3
+ <OutputType >Exe</OutputType >
4
+ <Optimize >True</Optimize >
5
+ </PropertyGroup >
6
+ <ItemGroup >
7
+ <Compile Include =" $(MSBuildProjectName).cs" />
8
+ </ItemGroup >
9
+ </Project >
You can’t perform that action at this time.
0 commit comments