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

transformations: (riscv_scf) add a pass to fuse perfectly nested loops #2540

Merged
merged 5 commits into from
May 6, 2024

Conversation

superlopuh
Copy link
Member

No description provided.

@superlopuh superlopuh added the transformations Changes or adds a transformatio label May 5, 2024
@superlopuh superlopuh self-assigned this May 5, 2024
Copy link

codecov bot commented May 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.80%. Comparing base (5237976) to head (ca3046d).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2540      +/-   ##
==========================================
- Coverage   89.81%   89.80%   -0.01%     
==========================================
  Files         351      352       +1     
  Lines       44108    44170      +62     
  Branches     6592     6603      +11     
==========================================
+ Hits        39615    39667      +52     
- Misses       3532     3543      +11     
+ Partials      961      960       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

transformations: (riscv_scf) add a pass to fuse perfectly nested loops
Copy link
Collaborator

@AntonLydike AntonLydike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this pass consider data dependencies between the loops? I think it'd be better to fuse at a higher level (before we get memrefs even) such that we can infer this more easily.

@AntonLydike
Copy link
Collaborator

Disregard my uninformed comment

Copy link
Collaborator

@AntonLydike AntonLydike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this really neat rewrite! This is very interesting! I would really like to see some more comments and documentation on the conditions and calculations (e.g. it has to be a nested for loop where outer_step = len(inner_range), inner_lb == 0, etc...)

On a side note, I am not sure if I would call this loop fusion. For me it implies that two loop bodies are merged into one. Isn't this closer to a canonicalization? It does not change any actual iteration domains, just simplifies IR.

tests/filecheck/dialects/riscv_scf/loop_fusion.mlir Outdated Show resolved Hide resolved
Copy link
Collaborator

@AntonLydike AntonLydike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@superlopuh superlopuh merged commit ab2bc78 into main May 6, 2024
10 checks passed
@superlopuh superlopuh deleted the sasha/riscv_scf/loop-fusion-pr branch May 6, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
transformations Changes or adds a transformatio
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants