When AtomicOrdering is release or stronger, use
amswap_db.[w/d] $zero, $a1, $a0
instead of
dbar 0 st.[w/d] $a0, $a1, 0
Thanks to @xry111 for the suggestion: https://reviews.llvm.org/D128901#3626635
Differential D129838
[LoongArch] Optimize the atomic store with amswap_db.[w/d] gonglingqin on Jul 15 2022, 12:23 AM. Authored by
Details When AtomicOrdering is release or stronger, use amswap_db.[w/d] $zero, $a1, $a0 instead of dbar 0 st.[w/d] $a0, $a1, 0 Thanks to @xry111 for the suggestion: https://reviews.llvm.org/D128901#3626635
Diff Detail
Event Timeline
Comment Actions I'm not sure about the changes (they are a little bit too much and I must admit I'm relatively weak at memory models) but the test case changes are good. I'd leave the LGTM to someone else for now...
|