Skip to content

[constant-folding] Eliminate complexity introducing pre-mature optimization. #27997

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

Conversation

gottesmm
Copy link
Contributor

The code that is deleted in this PR attempted to save a bit of compile time by:

  1. Checking if after constant folding we have a tuple that is immediately tuple
    extracted from.
  2. RAUW the tuple extracts directly from the tuple's operands.

This adds a bunch of complexity to the pass and also moves code that should be
in a visitor into the main pass workloop function.

After this PR what happens instead is that after we fold, we add the tuple to
the worklist. Then during the next iteration we look at the tuple_extract users
and simplify them at that point.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

…zation.

The code that is deleted in this PR attempted to save a bit of compile time by:

1. Checking if after constant folding we have a tuple that is immediately tuple
   extracted from.
2. RAUW the tuple extracts directly from the tuple's operands.

This adds a bunch of complexity to the pass and also moves code that should be
in a visitor into the main pass workloop function.

After this PR what happens instead is that after we fold, we add the tuple to
the worklist. Then during the next iteration we look at the tuple_extract users
and simplify them at that point.
@gottesmm gottesmm requested a review from atrick October 31, 2019 20:13
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm gottesmm merged commit 4a65109 into swiftlang:master Oct 31, 2019
@gottesmm gottesmm deleted the pr-96e6234768d2055870be817c97bbf375d0822f45 branch October 31, 2019 22:13
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.

1 participant