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

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 13:48:15 PST 2016


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

Today, we do not allow cmpxchg operations with pointer arguments.  We require the frontend to insert ptrtoint casts and do the cmpxchg in integers.  While correct, this is problematic from a couple of perspectives:
1) It makes the IR harder to analyse (for instance, it make capture tracking overly conservative)
2) It pushes work onto the frontend authors for no real gain

This patch implements the simplest form of IR support.  As we did with floating point loads and stores, we teach AtomicExpand to convert back to the old representation.  This prevents us needing to change all backends in a single lock step change.  Over time, we can migrate each backend to natively selecting the pointer type.  In the meantime, we get the advantages of a cleaner IR representation without waiting for the backend changes.

http://reviews.llvm.org/D17413

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17413.48400.patch
Type: text/x-patch
Size: 8862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160218/1fb97ab4/attachment.bin>


More information about the llvm-commits mailing list