Repository navigation
Fix handling of loop alignment targets - #97367
Conversation
Now that `BBJ_COND` block false target is not necessarily fall-through, the loop alignment code needs to consider the false target as what induces a loop via a false target back edge. Also, stop marking blocks after possible loop back edges for aligned loops as needing labels; they do not need to be so marked.
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsNow that Also, stop marking blocks after possible loop back edges for aligned loops as needing labels; they do not need to be so marked.
|
|
fyi, I found this with |
|
@kunalspathak @amanasifkhalid PTAL |
Diff results for #97367Throughput diffsThroughput diffs for linux/arm64 ran on windows/x64Overall (+0.01%)
MinOpts (+0.01% to +0.02%)
FullOpts (+0.00% to +0.01%)
Throughput diffs for linux/x64 ran on windows/x64Overall (+0.01% to +0.02%)
MinOpts (+0.01% to +0.03%)
FullOpts (+0.01%)
Throughput diffs for osx/arm64 ran on windows/x64Overall (+0.01%)
MinOpts (+0.01% to +0.02%)
FullOpts (+0.00% to +0.01%)
Throughput diffs for windows/arm64 ran on windows/x64Overall (+0.01%)
MinOpts (+0.01% to +0.02%)
FullOpts (+0.00% to +0.01%)
Throughput diffs for windows/x64 ran on windows/x64Overall (+0.03% to +0.05%)
MinOpts (+0.05% to +0.08%)
FullOpts (+0.03% to +0.04%)
Details here Throughput diffs for windows/x86 ran on windows/x86Overall (+0.01% to +0.02%)
MinOpts (+0.02% to +0.06%)
FullOpts (+0.01% to +0.02%)
Details here |
amanasifkhalid
left a comment
There was a problem hiding this comment.
CodeGen changes LGTM; I'll leave the emitter-level changes to Kunal. I look forward to seeing what else the flowgraph churn has messed with...
Can you remind me why this tracking is no longer needed? |
I was looking for cases that use I'll restore this label code with a comment to this effect. I'll also only set the label if |
This minimizes the size of an aligned loop by `getLoopSize`. Also, add `superpmi.py asmdiffs --alignloops` argument to allow specifying that you want to run asmdiffs with loop alignment enabled. By default, asmdiffs is done with loop alignment disabled, to avoid too many extraneous diffs.
|
This change does lead to new aligned loops in some cases. |
|
Here are summary diffs on win-x64 with Diffs are based on 2,492,126 contexts (977,958 MinOpts, 1,514,168 FullOpts). MISSED contexts: 6,660 (0.27%) Overall (+1,369 bytes)
FullOpts (+1,369 bytes)
|
|
@kunalspathak This is ready, with updates for feedback. Note to all: I added a |
| "DOTNET_JitDisasm": "*", | ||
| "DOTNET_JitUnwindDump": "*", | ||
| "DOTNET_JitEHDump": "*", | ||
| "DOTNET_JitDiffableDasm": "1", # to be removed |
There was a problem hiding this comment.
remember to undo this.
There was a problem hiding this comment.
Why? This is the obsolete switch which has been replaced with JitDisasmDiffable, which is still set.
There was a problem hiding this comment.
I misread your comment about "# to be removed" thinking that you want to revert this change before merging.
| } | ||
| else | ||
| { | ||
| assert(bbLabel->bbEmitCookie != nullptr); |
There was a problem hiding this comment.
The call to ehCodeOffset has the same assert, so it didn't seem necessary.
Diff results for #97367Throughput diffsThroughput diffs for linux/arm64 ran on windows/x64MinOpts (+0.00% to +0.01%)
Throughput diffs for linux/x64 ran on windows/x64Overall (+0.00% to +0.01%)
MinOpts (+0.01%)
FullOpts (+0.00% to +0.01%)
Throughput diffs for windows/arm64 ran on windows/x64MinOpts (+0.00% to +0.01%)
Throughput diffs for windows/x64 ran on windows/x64Overall (+0.00% to +0.01%)
MinOpts (+0.01%)
FullOpts (+0.00% to +0.01%)
Details here Throughput diffs for windows/x86 ran on windows/x86Overall (+0.01% to +0.02%)
MinOpts (+0.02% to +0.06%)
FullOpts (+0.01% to +0.02%)
Details here |
Now that
BBJ_CONDblock false target is not necessarily fall-through, the loop alignment code needs to consider the false target as what induces a loop via a false target back edge.Also, stop marking blocks after possible loop back edges for aligned loops as needing labels; they do not need to be so marked.