diff options
| author | Philip Reames <listmail@philipreames.com> | 2015-12-16 00:49:36 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2015-12-16 00:49:36 +0000 |
| commit | 61a24ab6cc305fec36c4b6389a1d6c966d12c259 (patch) | |
| tree | 243ac0dc51eaed9dd8be6b1d197d00a845994940 /llvm/test/Verifier/atomics.ll | |
| parent | e3fb51cf5ac539e4958245f2cd4df4aeaecf7c0e (diff) | |
| download | bcm5719-llvm-61a24ab6cc305fec36c4b6389a1d6c966d12c259.tar.gz bcm5719-llvm-61a24ab6cc305fec36c4b6389a1d6c966d12c259.zip | |
[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
llvm-svn: 255737
Diffstat (limited to 'llvm/test/Verifier/atomics.ll')
| -rw-r--r-- | llvm/test/Verifier/atomics.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/Verifier/atomics.ll b/llvm/test/Verifier/atomics.ll new file mode 100644 index 00000000000..ee7bf4bb19a --- /dev/null +++ b/llvm/test/Verifier/atomics.ll @@ -0,0 +1,14 @@ +; RUN: not opt -verify < %s 2>&1 | FileCheck %s + +; CHECK: atomic store operand must have integer or floating point type! +; CHECK: atomic load operand must have integer or floating point type! + +define void @foo(x86_mmx* %P, x86_mmx %v) { + store atomic x86_mmx %v, x86_mmx* %P unordered, align 8 + ret void +} + +define x86_mmx @bar(x86_mmx* %P) { + %v = load atomic x86_mmx, x86_mmx* %P unordered, align 8 + ret x86_mmx %v +} |

