-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[MachineSink] Consider multiple instructions when sinking into cycle #142641
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
Instructions are grouped into a sink unit called a "chain" and considered whether it's profitable to sink as a unit by looking at how many liveins and defs the chain has. If the chain has more defs than liveins, then sinking it will (almost always) reduce register pressure by the difference. Multiple chains sharing a livein are considered to not introduce this livein. The max register pressure is estimated in the cycle by estimating cycle liveins and using a reg pressure tracker for each block. Chains are sunk if they positively affect the critical pressure sets until the set is no longer above the max. This approach relies on the fact that values in the preheader will be live throughout the entire loop. So sinking a chain next to a use will almost always reduce pressure.
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-backend-systemz @llvm/pr-subscribers-backend-amdgpu Author: None (joe-rivos) ChangesInstructions are grouped into a sink unit called a "chain" and The max register pressure is estimated in the cycle by estimating cycle This approach relies on the fact that values in the preheader will be Patch is 182.36 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/142641.diff 3 Files Affected:
|
RFC link
Instructions are grouped into a sink unit called a "chain" and
considered whether it's profitable to sink as a unit by looking at how
many liveins and defs the chain has. If the chain has more defs than
liveins, then sinking it will (almost always) reduce register pressure
by the difference. Multiple chains sharing a livein are considered to
not introduce this livein.
The max register pressure is estimated in the cycle by estimating cycle
liveins and using a reg pressure tracker for each block. Chains are sunk
if they positively affect the critical pressure sets until the set is no
longer above the max.
This approach relies on the fact that values in the preheader will be
live throughout the entire loop. So sinking a chain next to a use will
almost always reduce pressure.