This is an archive of the discontinued LLVM Phabricator instance.

Support expanding partial-word cmpxchg to full-word cmpxchg in AtomicExpandPass.
ClosedPublic

Authored by jyknight on Jun 6 2016, 9:40 AM.

Details

Summary

Many CPUs only have 4-byte cmpxchg, and not 1/2-byte instructions. For
those, you need to mask and shift appropriately and use a 4-byte
cmpxchg.

This change adds support for cmpxchg-based instruction sets (only SPARC,
in LLVM). The support can be extended for LL/SC-based instruction
sets (e.g. PPC and MIPS) in the future, supplanting the ISel expansions
those architectures currently use.

Tests added for SPARCv9.

Diff Detail

Repository
rL LLVM

Event Timeline

jyknight updated this revision to Diff 59740.Jun 6 2016, 9:40 AM
jyknight retitled this revision from to Support expanding partial-word cmpxchg to full-word cmpxchg in AtomicExpandPass..
jyknight updated this object.
jyknight added a subscriber: llvm-commits.
lero_chris accepted this revision.Jun 16 2016, 8:29 AM
lero_chris edited edge metadata.
This revision is now accepted and ready to land.Jun 16 2016, 8:29 AM
This revision was automatically updated to reflect the committed changes.