Skip to content

[stable] Cherry-pick upstream fix for non-deterministic output #5287

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

akyrtzi
Copy link

@akyrtzi akyrtzi commented Sep 14, 2022

No description provided.

MaskRay and others added 3 commits September 14, 2022 00:38
…rectly" and "[SimplifyCFG] Make FoldCondBranchOnPHI more amenable to extension"

This reverts commit 3df86e7.
This reverts commit 8988254.

`[SimplifyCFG] Handle branch on same condition in pred more directly`
caused non-determinism when compiling opt with a bootstrapped clang.
I have to revert the dependent commit as well.

(cherry picked from commit 35e350d)
…sion (NFCI)

Reapply with SmallMapVector instead of SmallDenseMap, which should
address the non-determinism issue.

-----

This general threading transform can be performed whenever we know
a constant value for the condition in a predecessor, which would
currently just be the case of a phi node with constant arguments.

(cherry picked from commit df18e37)
…rectly

Reapplying without changes, after a fix to a dependent patch.

-----

Rather than creating a PHI node and then using the PHI threading
code, directly handle this case in
FoldCondBranchOnValueKnownInPredecessor().

This change is supposed to be NFC-ish, but may cause changes due
to different transform order.

(cherry picked from commit 993b166)
@akyrtzi
Copy link
Author

akyrtzi commented Sep 14, 2022

@swift-ci Please test

@akyrtzi akyrtzi merged commit fd4a62c into swiftlang:stable/20220421 Sep 14, 2022
@akyrtzi akyrtzi deleted the pr/stable/fix-non-deterministic-output branch September 14, 2022 14:57
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.

3 participants