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: (csl-stencil-bufferize) Fold csl_stencil.access that have no effect #3084

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

n-io
Copy link
Collaborator

@n-io n-io commented Aug 22, 2024

The csl-stencil-bufferize pass lowers stencil.field and tensor types to memref.

The type conversion pass creates the scenario that some csl_stencil.access ops are equal input and output types, for instance, (memref<512xf32>) -> memref<512xf32>. This only happens for ops accessing own data. In this case, the access op has no effect and can safely be folded away.

@n-io n-io added minor For minor PRs, easy and quick to review, quickly mergeable transformations Changes or adds a transformatio labels Aug 22, 2024
@n-io n-io self-assigned this Aug 22, 2024
@n-io n-io requested review from PapyChacal and dk949 August 22, 2024 15:03
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.89%. Comparing base (04fcab7) to head (23306ff).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3084      +/-   ##
==========================================
- Coverage   89.90%   89.89%   -0.01%     
==========================================
  Files         418      418              
  Lines       52914    52918       +4     
  Branches     8204     8205       +1     
==========================================
+ Hits        47571    47572       +1     
- Misses       4017     4019       +2     
- Partials     1326     1327       +1     

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

Copy link
Collaborator

@dk949 dk949 left a comment

Choose a reason for hiding this comment

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

LGTM, but I'm not 100% sure this is the right place to do this transformation. This rewrite ends up either transforming the access or converting it to a to_tensor

@n-io n-io merged commit 1e488d7 into main Aug 27, 2024
14 checks passed
@n-io n-io deleted the nicolai/fold-csl-stencil-access-ops branch August 27, 2024 19:58
@n-io
Copy link
Collaborator Author

n-io commented Aug 27, 2024

It only folds accesses that have no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor For minor PRs, easy and quick to review, quickly mergeable transformations Changes or adds a transformatio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants