Skip to content

[IPSCCP] Push constant struct params into callees #111805

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

Closed
wants to merge 1 commit into from

Conversation

MDevereau
Copy link
Contributor

This patch pushes constant alloca params into single use callees. This is beneficial in large functions emitted by fortran "box passing" which can combine multiple constant alloca parameters into one large alloca, which then results in duplicate unnecessary constant stores and less clear optimization paths.

This only works for CallInsts that have a single use with an alloca parameter, that of which's users are only stores and GEP's that are stored to one layer deep.

This patch pushes constant alloca params into single use callees.  This is
beneficial in large functions emitted by fortran "box passing" which can
combine multiple constant alloca parameters into one large alloca, which then
results in duplicate unnecessary constant stores and less clear optimization
paths.

This only works for CallInsts that have a single use with an alloca parameter,
that of which's users are only stores and GEP's that are stored to one layer
deep.
@MDevereau MDevereau changed the title [IPSCCP] Push constant struct params into callee's [IPSCCP] Push constant struct params into callees Oct 10, 2024
@nikic
Copy link
Contributor

nikic commented Oct 10, 2024

Is this targeting the same issue as #111163 or is this for something else? cc @hazzlim

@MDevereau
Copy link
Contributor Author

Is this targeting the same issue as #111163 or is this for something else? cc @hazzlim

The problems we're both looking at are very closely related. I'm currently looking at #111163 to see if it fixes the same issue I'm looking at. I've left it as a draft for now before we're certain.

@MDevereau
Copy link
Contributor Author

It seems this isn't targeting the same issues as #111163. This issue focuses on a Fortran problem which passes large constant structs to a call. The amount of elements that would needed to be promoted by argpromotion for this particular function is far too big for argpromotion to handle.

@MDevereau MDevereau closed this Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants