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

Expression: Remove logical literals in and/or operations during simplify #467

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

mlange05
Copy link
Collaborator

@mlange05 mlange05 commented Jan 8, 2025

The current implementation would only resolve .and./.or. operations if all arguments are logical literals. Instead, we can evaluate .true. and a => .true. and .false. and a => a, and vice versa for or operations. This allows us to further trim code paths in dead code elimination where this is used to remove conditionals.

The current implementation would only resolve .and./.or. operations
if all arguments are logical literals. Insterad, we can evaluate
`.true. and a` => `.true.` and `.false. and a` => `a`, and vice
versa for `or` operations.
@mlange05 mlange05 requested a review from reuterbal January 8, 2025 09:19
Copy link

github-actions bot commented Jan 8, 2025

Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/467/index.html

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.30%. Comparing base (ad1e2bc) to head (0aa2956).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #467   +/-   ##
=======================================
  Coverage   93.29%   93.30%           
=======================================
  Files         221      221           
  Lines       41360    41362    +2     
=======================================
+ Hits        38587    38592    +5     
+ Misses       2773     2770    -3     
Flag Coverage Δ
lint_rules 96.39% <ø> (ø)
loki 93.26% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Neat! Looks good to me! :shipit:

@reuterbal reuterbal added the ready to merge This PR has been approved and is ready to be merged label Jan 8, 2025
@reuterbal reuterbal merged commit 33c08c3 into main Jan 9, 2025
13 checks passed
@reuterbal reuterbal deleted the naml-symbolics-better-logical-eval branch January 9, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge This PR has been approved and is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants