Skip to content

[pred-memopt] Refactor/simplify a bit of pred-memopts. NFC. #28046

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

@gottesmm gottesmm commented Nov 4, 2019

I need to put in some code that handles load borrow differently from load copy. The way load_borrow was put in here was always a bit hacky, so it makes sense to do this refactoring. Specifically I:

  1. Copied promoteLoadCopy into 3 methods one for load [copy], load_borrow, copy_addr and flattened a bit of the conditional code as appropriate.
  2. I refactored out a bunch of the shared code related to computing available values into a helper that all three can use.

…, load, load_borrow.

NFC.

This just simplifies the code and makes it easier to reason about. I debried a
little bit as well, but nothing too much.
@gottesmm
Copy link
Contributor Author

gottesmm commented Nov 4, 2019

@swift-ci smoke test and merge

@gottesmm gottesmm requested a review from atrick November 4, 2019 01:18
@gottesmm
Copy link
Contributor Author

gottesmm commented Nov 4, 2019

As a nice additional win, the copy_addr handling code got significantly simpler.

@swift-ci swift-ci merged commit 13cdeff into swiftlang:master Nov 4, 2019
@gottesmm gottesmm deleted the pr-a32758bd7b10e19ef04df36d15343722c0c115a7 branch November 4, 2019 02: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.

2 participants