[PATCH] D15471: [IR] Add support for floating pointer and vector atomic loads and stores

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 11 16:15:57 PST 2015


reames created this revision.
reames added reviewers: jfb, hfinkel, jyknight.
reames added a subscriber: llvm-commits.

This patch allows atomic loads and stores of floating point or vector types 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.  

http://reviews.llvm.org/D15471

Files:
  docs/LangRef.rst
  lib/CodeGen/AtomicExpandPass.cpp
  lib/IR/Verifier.cpp
  test/CodeGen/X86/atomic-non-integer.ll
  test/Transforms/AtomicExpand/X86/expand-atomic-non-integer.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15471.42599.patch
Type: text/x-patch
Size: 14305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151212/cc0164ee/attachment.bin>


More information about the llvm-commits mailing list