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

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 14:24:42 PST 2016



On 02/19/2016 04:16 AM, David Chisnall wrote:
> 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.
Per previous discussion in the review, no there's no reason this 
couldn't be extended to floating point.  Patches welcome.  Happy to 
review, the patch should be pretty straight-forward.
>
> 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?
Are you referring to the clang work?  No, not directly, though it'll 
probable help there.  This was motivated by the needs of my downstream 
frontend and the observation that capture tracking was essentially 
broken for cmpxchg without it.
>
> ================
> 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.
Patches welcome.  :)
>
>
> Repository:
>    rL LLVM
>
> http://reviews.llvm.org/D17413
>
>
>



More information about the llvm-commits mailing list