Skip to content

Fix flipped 0/1 values in SimplifyBuiltin.optimizeAssertConfig #76046

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

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

kubamracek
Copy link
Contributor

The expectations for the resolved values of Builtin.assert_configuration() are (per AssertCommon.swift):

    // The values for the assert_configuration call are:
    // 0: Debug
    // 1: Release
    // 2: Fast / Unchecked

And this is how ConstantFolding.cpp implements it, but it turns out that the complementary SimplifyBuiltin pass is using wrong integer values. Let's fix that.

@kubamracek kubamracek requested a review from eeckstein August 22, 2024 21:48
@kubamracek kubamracek marked this pull request as ready for review August 22, 2024 21:48
@eeckstein
Copy link
Contributor

@swift-ci benchmark

Copy link
Contributor

@eeckstein eeckstein 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 fixing this!
You also need to fix the test case in SILOptimizer/simplify_builtin.sil

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek kubamracek merged commit ecce6ac into swiftlang:main Sep 18, 2024
5 checks passed
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.

2 participants