[IR] Add support for floating pointer atomic loads and stores
authorPhilip Reames <listmail@philipreames.com>
Wed, 16 Dec 2015 00:49:36 +0000 (00:49 +0000)
committerPhilip Reames <listmail@philipreames.com>
Wed, 16 Dec 2015 00:49:36 +0000 (00:49 +0000)
commit56318195bfc629213f2b45e8769c472b0e0ea425
tree0b8e57bc72c7a417f3f1f20eb240af08533af7f2
parentbca907f5fb210f2f4f6495ac8b0619c00351a3ca
[IR] Add support for floating pointer atomic loads and stores

This patch allows atomic loads and stores of floating point to be specified in the IR and adds an adapter to allow them to be lowered via existing backend support for bitcast-to-equivalent-integer idiom.

Previously, the only way to specify a atomic float operation was to bitcast the pointer to a i32, load the value as an i32, then bitcast to a float. At it's most basic, this patch simply moves this expansion step to the point we start lowering to the backend.

This patch does not add canonicalization rules to convert the bitcast idioms to the appropriate atomic loads. I plan to do that in the future, but for now, let's simply add the support. I'd like to get instruction selection working through at least one backend (x86-64) without the bitcast conversion before canonicalizing into this form.

Similarly, I haven't yet added the target hooks to opt out of the lowering step I added to AtomicExpand. I figured it would more sense to add those once at least one backend (x86) was ready to actually opt out.

As you can see from the included tests, the generated code quality is not great. I plan on submitting some patches to fix this, but help from others along that line would be very welcome. I'm not super familiar with the backend and my ramp up time may be material.

Differential Revision: http://reviews.llvm.org/D15471

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255737 91177308-0d34-0410-b5e6-96231b3b80d8
docs/LangRef.rst
lib/CodeGen/AtomicExpandPass.cpp
lib/IR/Verifier.cpp
test/CodeGen/X86/atomic-non-integer.ll [new file with mode: 0644]
test/Transforms/AtomicExpand/X86/expand-atomic-non-integer.ll [new file with mode: 0644]
test/Verifier/atomics.ll [new file with mode: 0644]