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

Document GlobalISel's combiner guidelines #92309

Open
aemerson opened this issue May 15, 2024 · 1 comment
Open

Document GlobalISel's combiner guidelines #92309

aemerson opened this issue May 15, 2024 · 1 comment

Comments

@aemerson
Copy link
Contributor

@tschuett made a good point that our approach to writing combiners in GlobalISel needs some documentation here: #91922

This issue is to track that initial work on elaborating things like:

  • Combiner best practices
  • Rationales for what we do
  • Artifact vs regular combiner
  • Notable exceptions to the above and why they're there
@tschuett
Copy link
Member

I vote for a section about the combiner design. We compile the Combine.td into a matchable. 10 more lines.

Complex logic is delegated to CombinerHelper Helper.

From this design, we can conclude:

  • Keep as much logic as possible in Combine.td and less logic in the Helper => lower compile time.
  • visit functions are an anti pattern. They delegate too much logic into the helper => higher compile time.
  • Many tight, precise, and small combines for lower compile time and targets can pick the choices.

tschuett added a commit to tschuett/llvm-project that referenced this issue May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants