File tree 2 files changed +11
-9
lines changed
libraries/System.Private.CoreLib/src/System
2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -2863,7 +2863,17 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
2863
2863
if (isIntrinsic)
2864
2864
{
2865
2865
// The recursive non-virtual calls to Jit intrinsics are must-expand by convention.
2866
- mustExpand = gtIsRecursiveCall (method) && !(methodFlags & CORINFO_FLG_VIRTUAL);
2866
+ if ((ni > NI_HW_INTRINSIC_START) && (ni < NI_SIMD_AS_HWINTRINSIC_END))
2867
+ {
2868
+ // Keep the previous logic for HW intrinsics. Some of the recursive calls with [Intrinsic]
2869
+ // don't have to be expanded in JIT (e.g. various imm-able intrinsics where the imm-argument is not
2870
+ // a constant). To remove this quirk, we need to slightly refactor the mustExpand logic for HWIntrinsics.
2871
+ mustExpand = gtIsRecursiveCall (method) && !(methodFlags & CORINFO_FLG_VIRTUAL);
2872
+ }
2873
+ else
2874
+ {
2875
+ mustExpand = (info.compMethodHnd == method) && !(methodFlags & CORINFO_FLG_VIRTUAL);
2876
+ }
2867
2877
}
2868
2878
else
2869
2879
{
Original file line number Diff line number Diff line change @@ -127,20 +127,12 @@ public virtual Type[] GetGenericParameterConstraints()
127
127
protected virtual bool IsMarshalByRefImpl ( ) => false ;
128
128
public bool IsPrimitive
129
129
{
130
- #if NATIVEAOT
131
- // https://github.com/dotnet/runtime/issues/97272
132
- [ MethodImpl ( MethodImplOptions . NoOptimization ) ]
133
- #endif
134
130
[ Intrinsic ]
135
131
get => IsPrimitiveImpl ( ) ;
136
132
}
137
133
protected abstract bool IsPrimitiveImpl ( ) ;
138
134
public bool IsValueType
139
135
{
140
- #if NATIVEAOT
141
- // https://github.com/dotnet/runtime/issues/97272
142
- [ MethodImpl ( MethodImplOptions . NoOptimization ) ]
143
- #endif
144
136
[ Intrinsic ]
145
137
get => IsValueTypeImpl ( ) ;
146
138
}
You can’t perform that action at this time.
0 commit comments