This is an archive of the discontinued LLVM Phabricator instance.

[atomics] Rewrite the fallback path of llvm::call_once to use std::atomic instead of the home-grown LLVM atomic type.
Needs ReviewPublic

Authored by chandlerc on Jun 6 2016, 6:17 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This seems strictly more likely to be correct and is also probably more
efficient on some platforms. I think I've gotten the memory orderings
correct, but a second pair of eyes is very welcome here, notably to make
sure that in all cases the Done synchronizes with works correctly and it
is not possible to release threads prior to the effects of calling the
function being visible to all threads.

If this looks good, and it sticks, and ...., I'll be able to remove
llvm::cas_flag entirely.

Diff Detail

Event Timeline

chandlerc updated this revision to Diff 59815.Jun 6 2016, 6:17 PM
chandlerc retitled this revision from to [atomics] Rewrite the fallback path of llvm::call_once to use std::atomic instead of the home-grown LLVM atomic type..
chandlerc updated this object.
chandlerc added a subscriber: llvm-commits.