[PATCH] [X86] Make wide loads be managed by AtomicExpand

Robin Morisset morisset at google.com
Tue Sep 23 09:58:54 PDT 2014


The tests for cmpxchg16b were indeed testing for the lock prefix, but not the tests for the 8b version. I will upload a new patch with an improved test (and preserved FIXME).

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:17360
@@ -17359,3 @@
-  //        (The only way to get a 16-byte load is cmpxchg16b)
-  // FIXME: 16-byte ATOMIC_CMP_SWAP isn't actually hooked up at the moment.
-  SDValue Zero = DAG.getConstant(0, VT);
----------------
jfb wrote:
> These FIXMEs should probably be kept. How would they get fixed with this new infrastructure? `shouldExpandAtomicLoadInIR` would change to take that into account, and `ReplaceATOMIC_LOAD` would do the work?
The second comment looks obsolete to me: 16-bytes Cmpxchg definitely works on x86 in recent versions of LLVM, and there are lots of tests of it.
The first comment may indeed more interesting to preserve, I will keep it in this file (in shouldExpandAtomicLoad). If someone wants to try it someday, they will have to make shouldExpandAtomicLoad return false for this case, and do the lowering themselves (as it is a completely target-dependent trick).

http://reviews.llvm.org/D5404






More information about the llvm-commits mailing list