[mono][aot] Prefer concrete instances instead of gshared ones for met… (#78182)
authorZoltan Varga <vargaz@gmail.com>
Fri, 11 Nov 2022 21:15:35 +0000 (16:15 -0500)
committerGitHub <noreply@github.com>
Fri, 11 Nov 2022 21:15:35 +0000 (16:15 -0500)
commit486682a719e064ed30dd4c6db94f5c34a05ad5f2
treefcdfc92f99e9c7dd53399c31d8b5540867622b72
parent29a2bc564e329a3a90aa2a123ba8395dac1c5ca1
[mono][aot] Prefer concrete instances instead of gshared ones for met… (#78182)

* [mono][aot] Prefer concrete instances instead of gshared ones for methods containing type equality checks.

For example, calls to Vector<T>.IsSupported cannot be optimized away in a method where T
is T_BYTE because its written as:

```
            get => (typeof(T) == typeof(byte)) ||
                   (typeof(T) == typeof(double)) ||
```

and T_BYTE could be instantiated with an enum whose basetype is byte.

Fixes some of the issues in https://github.com/dotnet/runtime/issues/78163.

* Avoid an assert when compiling Vector<object> instances.
src/mono/mono/mini/intrinsics.c
src/mono/mono/mini/simd-intrinsics.c