Skip to content

Intrinsify typeof(T).IsGenericType - #99555

Merged
MihaZupan merged 21 commits into
dotnet:mainfrom
Sergio0694:user/sergiopedri/is-generic-type-intrinsic
Jun 16, 2024
Merged

Intrinsify typeof(T).IsGenericType#99555
MihaZupan merged 21 commits into
dotnet:mainfrom
Sergio0694:user/sergiopedri/is-generic-type-intrinsic

Conversation

@Sergio0694

Copy link
Copy Markdown
Contributor

Contributes to #96898

publicstaticboolTest<T>()=>typeof(T).IsGenericType;

Codegen diffs:

; Assembly listing for method Methods:Test[int]():ubyte (FullOpts)
- sub rsp, 40- mov rcx, 0x1D980105580 ; 'System.Int32'- call [System.RuntimeType:get_IsGenericType():ubyte:this]- add rsp, 40+ xor eax, eax
ret
; Assembly listing for method Methods:Test[System.Nullable`1[int]]():ubyte (FullOpts)
- sub rsp, 40- mov rcx, 0x1D980109298 - call [System.RuntimeType:get_IsGenericType():ubyte:this]- nop - add rsp, 40+ mov eax, 1
ret ; Assembly listing for method Methods:Test[System.Collections.Generic.KeyValuePair`2[System.__Canon,System.__Canon]]():ubyte (FullOpts)
- sub rsp, 40- mov qword ptr [rsp+0x20], rcx- mov rcx, qword ptr [rcx+0x38]- mov rcx, qword ptr [rcx]- call CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE- mov rcx, rax- call [System.RuntimeType:get_IsGenericType():ubyte:this]- nop - add rsp, 40+ mov eax, 1
ret

Note

Reopening from #97148 because I force pushed while that was closed 😅

@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 11, 2024
@Sergio0694
Sergio0694force-pushed the user/sergiopedri/is-generic-type-intrinsic branch from 95c36b3 to 721ad3fCompareMarch 11, 2024 19:00
@dotnet-policy-servicedotnet-policy-serviceBot added the community-contribution Indicates that the PR has been added by a community member label Mar 11, 2024
@Sergio0694
Sergio0694 requested a review from EgorBoMarch 11, 2024 19:01
Comment threadsrc/coreclr/vm/jitinterface.cpp Outdated
@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

/cc @davidwrighton

@Sergio0694
Sergio0694force-pushed the user/sergiopedri/is-generic-type-intrinsic branch from 721ad3f to 5489ea9CompareMarch 11, 2024 20:43
@Sergio0694

Copy link
Copy Markdown
ContributorAuthor

@MihuBot

Comment threadsrc/coreclr/inc/corinfo.h Outdated
@AaronRobinsonMSFTAaronRobinsonMSFT added the needs-author-action An issue or pull request that requires more info or actions from the author. label Mar 12, 2024
@dotnet-policy-servicedotnet-policy-serviceBot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Mar 12, 2024
@Sergio0694
Sergio0694force-pushed the user/sergiopedri/is-generic-type-intrinsic branch 2 times, most recently from c2452c0 to 5412512CompareMarch 12, 2024 21:02
@Sergio0694

Copy link
Copy Markdown
ContributorAuthor

@MihuBot

Comment threadsrc/coreclr/vm/jitinterface.cpp Outdated
Comment threadsrc/tests/JIT/Intrinsics/TypeIntrinsics.cs
Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Outdated
@Sergio0694
Sergio0694force-pushed the user/sergiopedri/is-generic-type-intrinsic branch from e8e62ea to f2381eeCompareMarch 13, 2024 16:57
@Sergio0694

Copy link
Copy Markdown
ContributorAuthor

@MihuBot

Comment threadsrc/coreclr/vm/jitinterface.cpp Outdated
@Sergio0694
Sergio0694force-pushed the user/sergiopedri/is-generic-type-intrinsic branch from 0ff7827 to 75967c2CompareJune 16, 2024 16:16
@Sergio0694

Copy link
Copy Markdown
ContributorAuthor

Only non-well-known failing test seems to be:

LibraryImportGenerator.UnitTests.Compiles.ValidateNoGeneratedOutputForNoImport

NuGet.Protocol.Core.Types.FatalProtocolException : An error occurred while retrieving package metadata for 'Microsoft.NETFramework.ReferenceAssemblies.net48.1.0.2' from source 'nuget.org'.
---- System.Net.Http.HttpRequestException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (api.nuget.org:443)
-------- System.Net.Sockets.SocketException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Seems unrelated?

@MihaZupan
MihaZupan merged commit f4fd3ea into dotnet:mainJun 16, 2024
@Sergio0694
Sergio0694 deleted the user/sergiopedri/is-generic-type-intrinsic branch June 16, 2024 18:49
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 17, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@Sergio0694@AaronRobinsonMSFT@jkotas@JulieLeeMSFT@EgorBo@MichalStrehovsky@MihaZupan