-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] Don't replace unused
atomicrmw xchg
with atomic store
Following the discussion from https://reviews.llvm.org/D141277 and in particular Ralf Jung's comment at https://reviews.llvm.org/D141277#inline-1365148, replacing an unused `atomicrmw xchg` into an `atomic store` is illegal even for release ordering. Quoting Connor Horman from the rust lang discussion linked in that comment: "An acquire operation A only synchronizes-with a release operation R if it takes its value from R, or any store in the release sequence headed by R, which is R, followed by the longest continuous sequence of read-modify-write operations. A regular store following R in the modification order would break the release sequence, and if an acquire operation reads that store or something later, then it loses any synchronization it might have already had." This fixes #60418 Differential Revision: https://reviews.llvm.org/D142097
- Loading branch information
Showing
2 changed files
with
6 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters