Skip to content

[Attributor] IPO across non-amenable call edges #172

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

Open
5 tasks
jdoerfert opened this issue Mar 13, 2020 · 0 comments
Open
5 tasks

[Attributor] IPO across non-amenable call edges #172

jdoerfert opened this issue Mar 13, 2020 · 0 comments
Assignees
Labels
gsoc Google Summer of Code help wanted Indicates that a maintainer wants help. Not [good first issue]. ipo Interprocedural optimizations metabug Issue to collect references to a group of similar or related issues.

Comments

@jdoerfert
Copy link
Member

If a function is externally visible, the address is potentially taken, or certain uses are non-trivial, we are conservative when it comes to inter-procedural optimizations (IPO). That is, we do not propagate information from the call sites we know to the called function (=callee). Similarly, when the function has a non-exact definition we do not propagate information from the called function we see to the call sites.

To mitigate both problems we can "internalize" the function, or put differently, specialize the called function (the one we see) to (a subset of) the call sites we see.

Prototypes of what we need are available already D63312 and D63319 especially.

This metabug is to allow us to track the overall task as we split it up in smaller chunks. Thus, we expect this bug to be edited as we go.

  • Allow us to derive "inwards facing" attributes on non-exact function call interfaces. That is, if we have a function that is non-exact, we can still annotate arguments if we either create a thin wrapper around the function (see D63312) or the annotation is not going to be used (=usable) at the call sites.
  • Utilities to create a dependence graph in the Attributor. Nodes are AbstractAttributes, edges are dependences as recorded in the Attributor::QueryMap. We need functions to print the dependence graph, determine sub-graphs that contain a set of specified nodes, ... A new issue will be created for this.
  • Design a cost function interface for AbstractAttributes and populate it with value for the existing ones. E.g., determining dereferenceable on a pointer argument is worth almost nothing if it is not used but potentially quite useful if it is loaded from in a loop, even more if it is additionally readonly and noalias, etc.
  • Design experiments to determine the impact and good trade-offs. At the end of the day we want to see how function internalization plays against inlining wrt. compile time, runtime, and size. We need experiments that try out different combinations from aggressive inlining to no inlining at all.
  • Analyze the cases one of the methods is "clearly" superior to determine (1) why and (2) if we can generalize that into a heuristic that drives the optimization.
@jdoerfert jdoerfert added A-llvm gsoc Google Summer of Code metabug Issue to collect references to a group of similar or related issues. labels Mar 13, 2020
@jdoerfert jdoerfert self-assigned this Mar 13, 2020
@jdoerfert jdoerfert added the help wanted Indicates that a maintainer wants help. Not [good first issue]. label Mar 13, 2020
@asl asl removed the A-llvm label Apr 3, 2020
am11 pushed a commit to am11/llvm-project that referenced this issue Mar 29, 2022
…211.10 (llvm#172)

[objwriter/12.x] Update dependencies from dotnet/arcade
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
This patch is based on D63312 and D63319. For now we create shallow wrappers for all functions that are IPO amendable.
See also [this github issue](llvm/llvm-project#172).

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D76404
@thesamesam thesamesam added the ipo Interprocedural optimizations label Mar 12, 2024
moodyhunter pushed a commit to moodyhunter/llvm-project that referenced this issue Mar 26, 2024
jpinot pushed a commit to jpinot/llvm-project that referenced this issue Apr 9, 2025
…clause). See more.

Fow now, and since OpenMP has already done the work for us let's take profit of it.
'compare' clause is not as easily to copy since it's implemented in OpenMPIRBuilder.
We're a bit outdated in this part, so I'd prefer to update our OmpSsIRBuilder before
adding support for it.

Also, we have not decided if it'd be better to implement the
directive in LLVM Transform phase or not, and how to do it
portable enough.

Closes llvm#172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc Google Summer of Code help wanted Indicates that a maintainer wants help. Not [good first issue]. ipo Interprocedural optimizations metabug Issue to collect references to a group of similar or related issues.
Projects
None yet
Development

No branches or pull requests

3 participants