Skip to content
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

JIT optimization: tail merge #8795

Closed
JosephTremoulet opened this issue Aug 23, 2017 · 0 comments · Fixed by #77103
Closed

JIT optimization: tail merge #8795

JosephTremoulet opened this issue Aug 23, 2017 · 0 comments · Fixed by #77103
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI enhancement Product code improvement that does NOT require public API changes/additions optimization tenet-performance Performance related issue
Milestone

Comments

@JosephTremoulet
Copy link
Contributor

Tracking issue for a classic codesize optimization that's not currently implemented in RyuJIT. The optimization would find predecessors of a common successor (along non-critical edges) that all end in equivalent sequences leading up to the join, and move the gotos and join earlier such that statically only one copy of the equivalent sequence remains. We'd want to treat returns as "joining" at the continuation so that we could eliminate redundant epilogs when a function has (statically) multiple returns of the same expression.

category:cq
theme:optimization
skill-level:expert
cost:medium

JosephTremoulet referenced this issue in JosephTremoulet/corefx Aug 23, 2017
Remove some `goto`s that were added to work around dotnet/coreclr#9692
(poor code layout for loop exit paths) -- the JIT's layout decisions
were improved in dotnet/coreclr#13314, and these particular `goto`s are
no longer needed; the same machine code is generated with or without
this change.
Some `goto`s previously tagged as workarounds for dotnet/coreclr#9692 are
still relevant for keeping codesize down pending dotnet/coreclr#13549;
update their comments accordingly.

Part of #23395.
JosephTremoulet referenced this issue in JosephTremoulet/corefx Aug 23, 2017
Remove some `goto`s that were added to work around dotnet/coreclr#9692
(poor code layout for loop exit paths) -- the JIT's layout decisions
were improved in dotnet/coreclr#13314, and these particular `goto`s are
no longer needed; the same machine code is generated with or without
this change.
Some `goto`s previously tagged as workarounds for dotnet/coreclr#9692 are
still relevant for keeping codesize down pending dotnet/coreclr#13549;
update their comments accordingly.

Part of #23395.
JosephTremoulet referenced this issue in JosephTremoulet/corefx Aug 23, 2017
Remove some `goto`s that were added to work around dotnet/coreclr#9692
(poor code layout for loop exit paths) -- the JIT's layout decisions
were improved in dotnet/coreclr#13314, and these particular `goto`s are
no longer needed; the same machine code is generated with or without
this change.
Some `goto`s previously tagged as workarounds for dotnet/coreclr#9692 are
still relevant for keeping codesize down pending dotnet/coreclr#13549;
update their comments accordingly.

Part of #23395.
jkotas referenced this issue in dotnet/corefx Aug 24, 2017
Remove some `goto`s that were added to work around dotnet/coreclr#9692
(poor code layout for loop exit paths) -- the JIT's layout decisions
were improved in dotnet/coreclr#13314, and these particular `goto`s are
no longer needed; the same machine code is generated with or without
this change.
Some `goto`s previously tagged as workarounds for dotnet/coreclr#9692 are
still relevant for keeping codesize down pending dotnet/coreclr#13549;
update their comments accordingly.

Part of #23395.
ycrumeyrolle referenced this issue in uruk-project/Jwt Feb 26, 2019
* Jwk.Use property is now a byte array.

* use & Alg as byte array

* "enc" & "zip" are now byte array

* Optimize some functions with the same return value more than once.
https://github.com/dotnet/coreclr/issues/13549

* Avoid to analyze the Header if there is less than 3 segments

* Cty, Zip as byte[]

* Apply ThrowNullReferenceException pattern with an enum as parameter instead of a string.

* Optimize Tokenizer by unrolling the loop
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@BruceForstall BruceForstall added the JitUntriaged CLR JIT issues needing additional triage label Oct 28, 2020
@BruceForstall BruceForstall removed the JitUntriaged CLR JIT issues needing additional triage label Nov 24, 2020
sakno referenced this issue in dotnet/dotNext Dec 20, 2021
AndyAyersMS added a commit to AndyAyersMS/runtime that referenced this issue Oct 16, 2022
Add a phase that looks for common tail statements in a block's
predecessors and merges them.

Run it both before and after morph.

Closes dotnet#8795.
Closes dotnet#76872.
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Oct 16, 2022
AndyAyersMS added a commit that referenced this issue Oct 25, 2022
Add a phase that looks for common tail statements in a block's
predecessors and merges them.

Run it both before and after morph.

Also
* add range enable config and overall `JitEnableTailMerge` config
* add indir flag checking to `GenTree::Compare`
* remove an apparently unnecessary assert from loop recognition.

Closes #8795.
Closes #76872.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Oct 25, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI enhancement Product code improvement that does NOT require public API changes/additions optimization tenet-performance Performance related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants