Skip to content

[pmo] Re-apply load [copy] fixes eliminating some non-determinism that came up. #28314

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

Conversation

gottesmm
Copy link
Contributor

I reapplied and put the commit that eliminated the non-determinism on top. The commit msg for that commit is:


[pmo] Eliminate non-determinism by unmixing some iteration order/sorting bisection code.

Specifically, I was abusing some sorting behavior on some arrays that I really
needed to iterate over == non-determinism. To work around these issues, I made
two changes:

  1. Rather than using a bit vector to mark copy_values that were handled as part
    of phi handling and thus needing a way to map copy_value -> bit vector index, I
    instead just added a separate small ptr set called
    copyValueProcessedWithPhiNodes.

  2. I refactored/changed how copy cleanups were inserted for phi nodes by
    constructing a flat 2d-array that is stable sorted by the index of the incoming
    value associated with the cleanups. An incoming value's index is the count of
    the copy cleanup when we see it for the first time. Thus when we do the stable
    sort we will be visiting in cleanup insertion order and also will be doing
    insertion order along the incomingValue axis.

rdar://57257309

…ing bisection code.

Specifically, I was abusing some sorting behavior on some arrays that I really
needed to iterate over == non-determinism. To work around these issues, I made
two changes:

1. Rather than using a bit vector to mark copy_values that were handled as part
of phi handling and thus needing a way to map copy_value -> bit vector index, I
instead just added a separate small ptr set called
copyValueProcessedWithPhiNodes.

2. I refactored/changed how copy cleanups were inserted for phi nodes by
constructing a flat 2d-array that is stable sorted by the index of the incoming
value associated with the cleanups. An incoming value's index is the count of
the copy cleanup when we see it for the first time. Thus when we do the stable
sort we will be visiting in cleanup insertion order and also will be doing
insertion order along the incomingValue axis.
@gottesmm
Copy link
Contributor Author

I tested this locally and it eliminated these issues for me.

@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci asan test

@gottesmm
Copy link
Contributor Author

preset=buildbot,tools=R,stdlib=RD
@swift-ci Please test with preset macOS Platform

@gottesmm gottesmm requested review from atrick and beccadax November 17, 2019 11:58
@gottesmm
Copy link
Contributor Author

@brentdax I started off a custom preset job that should run the same preset as the bot did. So we can be sure it doesnt happen.

@gottesmm gottesmm merged commit c2be4a1 into swiftlang:master Nov 17, 2019
@gottesmm gottesmm deleted the pr-9eb0e6cb15b67bf611cbe9574fcc32bfcede914e branch November 17, 2019 15: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