summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc/SparcISelLowering.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2016-06-17 18:11:48 +0000
committerJames Y Knight <jyknight@google.com>2016-06-17 18:11:48 +0000
commit148a6469dccf3c8a20874b1b451549826a1e4da8 (patch)
tree7f92528634d462dd81abeb5735c3c4cc8ce4f4e1 /llvm/lib/Target/Sparc/SparcISelLowering.cpp
parent4cccc488b78c8e3258828a1f18ffc9e61b184bee (diff)
downloadbcm5719-llvm-148a6469dccf3c8a20874b1b451549826a1e4da8.tar.gz
bcm5719-llvm-148a6469dccf3c8a20874b1b451549826a1e4da8.zip
Support expanding partial-word cmpxchg to full-word cmpxchg in AtomicExpandPass.
Many CPUs only have the ability to do a 4-byte cmpxchg (or ll/sc), not 1 or 2-byte. For those, you need to mask and shift the 1 or 2 byte values appropriately to use the 4-byte instruction. This change adds support for cmpxchg-based instruction sets (only SPARC, in LLVM). The support can be extended for LL/SC-based PPC and MIPS in the future, supplanting the ISel expansions those architectures currently use. Tests added for the IR transform and SPARCv9. Differential Revision: http://reviews.llvm.org/D21029 llvm-svn: 273025
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcISelLowering.cpp')
-rw-r--r--llvm/lib/Target/Sparc/SparcISelLowering.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
index 895593528ae..605acd6df05 100644
--- a/llvm/lib/Target/Sparc/SparcISelLowering.cpp
+++ b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
@@ -1647,6 +1647,8 @@ SparcTargetLowering::SparcTargetLowering(const TargetMachine &TM,
else
setMaxAtomicSizeInBitsSupported(0);
+ setMinCmpXchgSizeInBits(32);
+
setOperationAction(ISD::ATOMIC_SWAP, MVT::i32, Legal);
setOperationAction(ISD::ATOMIC_FENCE, MVT::Other, Legal);
OpenPOWER on IntegriCloud