-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[RISC-V] Enable instruction printing for PHASE Generate code in JIT dump
#122485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@dotnet-policy-service agree |
PHASE Generate code of JIT dumpPHASE Generate code in JIT dump
tomeksowi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you run some asmdiffs to make sure these changes don't affect the actual codegen?
| if ((addr == nullptr) && (offset == 0)) | ||
| { | ||
| // If address is not given, print placeholder instead. | ||
| printf("??"); | ||
| } | ||
| else | ||
| { | ||
| emitDispImmediate(offset, false); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Branches without a label may need similar treatment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handled non-labeled branch offsets in emitDispBranchOffset. Thanks.
|
No differences were found when compared with Diffs are based on 87,412 contexts (85,743 MinOpts, 1,669 FullOpts). Overall (+0 bytes)
MinOpts (+0 bytes)
FullOpts (+0 bytes)
Example diffsSystem.mch+0 (0.00%) : 29.dasm - System.Diagnostics.Tracing.EventSource:InitializeDefaultEventSources() (FullOpts)No diffs found? +0 (0.00%) : 33.dasm - System.AppContext:TryGetSwitch(System.String,byref):bool (FullOpts)No diffs found? +0 (0.00%) : 109.dasm - System.RuntimeType+RuntimeTypeCache+MemberInfoCache`1[System.__Canon]:Populate(System.String,int,int):System.__Canon[]:this (FullOpts)No diffs found? +0 (0.00%) : 87356.dasm - System.Net.Http.HPack.HPackEncoder:EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedArray(System.String):byte[] (MinOpts)No diffs found? +0 (0.00%) : 87352.dasm - System.Net.Http.HPack.HPackEncoder:EncodeValueStringPart(System.String,System.Span`1[byte]) (MinOpts)No diffs found? +0 (0.00%) : 87348.dasm - System.Net.Http.HPack.HPackEncoder:EncodeLiteralHeaderFieldWithoutIndexing(int,System.Span`1[byte],byref):bool (MinOpts)No diffs found? DetailsSize improvements/regressions per collection
PerfScore improvements/regressions per collection
Context information
jit-analyze output |
|
After the change, asmdiffs showed no differences compared to Diffs are based on 87,627 contexts (85,970 MinOpts, 1,657 FullOpts). Overall (+0 bytes)
MinOpts (+0 bytes)
FullOpts (+0 bytes)
Example diffsSystem.mch+0 (0.00%) : 1409.dasm - System.Diagnostics.Process:GetNextArgument(System.String,byref):System.String (MinOpts)No diffs found? +0 (0.00%) : 1985.dasm - System.ModuleHandle:ResolveTypeHandle(int,System.RuntimeTypeHandle[],System.RuntimeTypeHandle[]):System.RuntimeTypeHandle:this (FullOpts)No diffs found? +0 (0.00%) : 3841.dasm - System.Timers.Timer:.ctor():this (MinOpts)No diffs found? +0 (0.00%) : 79424.dasm - System.Threading.RateLimiting.DefaultPartitionedRateLimiter`2+d__20[System.__Canon,long]:MoveNext():this (MinOpts)No diffs found? +0 (0.00%) : 78464.dasm - System.Net.Security.SslApplicationProtocol:.cctor() (MinOpts)No diffs found? +0 (0.00%) : 77568.dasm - System.Text.Encodings.Web.OptimizedInboxTextEncoder+AsciiPreescapedData:PopulatePreescapedData(byref,System.Text.Encodings.Web.ScalarEscaperBase):this (MinOpts)No diffs found? DetailsSize improvements/regressions per collection
PerfScore improvements/regressions per collection
Context information
jit-analyze output |
RISC-V instructions were not printed during
PHASE Generate code, which made debugging inconvenient.This PR enables printing RISC-V instructions when
JitDumpis set:Before (
PHASE Generate code):After (
PHASE Generate code):Limitation
In the current RISC-V implementation, it's difficult to compute the actual jump offset during CodeGen. Thus, a placeholder "??" is printed instead.
@clamp03 @tomeksowi @namu-lee @credo-quia-absurdum
part of #84834, cc @dotnet/samsung