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

Simplify conditionals codegen + add missing side effects checks. #7151

Merged
merged 10 commits into from
Nov 10, 2024

Conversation

cristianoc
Copy link
Collaborator

@cristianoc cristianoc commented Nov 8, 2024

Fixes #7142

  • x ? y : false --> x && y

  • x ? false : y --> !x && y

  • push negation inside when it leads to simplification

  • fix some missing checks for side effects on optimisations

Fixes #7142

- x ? y : false --> x && y
- x ? false : y --> !x && y
- push negation inside when it leads to simplification
@cristianoc cristianoc requested review from cknitt and zth November 8, 2024 12:34
Copy link
Collaborator

@zth zth left a comment

Choose a reason for hiding this comment

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

Fantastic!

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Syntax Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: 1a5f286 Previous: e1b7fb7 Ratio
Print RedBlackTreeNoComments.res - time/run 2.228255373333333 ms 2.10057036 ms 1.06

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

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

Great! 👍
Tested against a real-life project and looks good.

@cristianoc cristianoc changed the title Simplify conditionals. Simplify conditionals codegen + add missing side effects checks. Nov 10, 2024
@cristianoc cristianoc merged commit 682c8a0 into master Nov 10, 2024
20 checks passed
@cristianoc cristianoc deleted the simplify_conditionals branch November 10, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Further simplification of untagged variant output
3 participants