[PATCH] D17413: [IR] Extend cmpxchg to allow pointer type operands

David Chisnall via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 04:16:05 PST 2016


theraven added inline comments.

================
Comment at: llvm/trunk/docs/LangRef.rst:7091
@@ -7092,1 +7090,3 @@
+optimizer is not allowed to modify the number or order of execution of
+this ``cmpxchg`` with other :ref:`volatile operations <volatile>`.
 
----------------
Is there a reason to disallow floating point types?  C11 expects compare and exchange to work on floating point types, and requiring casts to integer types doesn't play particularly nicely with TBAA.

Given the recent mailing list discussion, is this part of the work to allow the front end to provide any type here and lower to a library call closer to the back end?

================
Comment at: llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp:179
@@ +178,3 @@
+        // TODO: add a TLI hook to control this so that each target can
+        // convert to lowering the original type one at a time.
+        CASI = convertCmpXchgToIntegerType(CASI);
----------------
This TODO is quite important for us.  We're currently unable to use or pointer LL/SC instructions from C because our target does not have a valid integer type as big as our pointer type.


Repository:
  rL LLVM

http://reviews.llvm.org/D17413





More information about the llvm-commits mailing list