[PATCH] D12557: [AtomicExpand] Refactor load/cmpxchg callbacks to make LLSC explicit. NFCI.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 09:07:46 PDT 2015


ab created this revision.
ab added reviewers: morisset, jfb, t.p.northover.
ab added a subscriber: llvm-commits.

We used to have this magic "hasLLSC()" callback, which really meant two things:
- expand cmpxchg (to ll/sc).
- expand atomic loads using ll/sc (rather than cmpxchg).

Instead, introduce explicit callbacks:
- bool shouldExpandAtomicCmpXchgInIR(inst)
- AtomicExpansionKind shouldExpandAtomicLoadInIR(inst)
and rename AtomicRMWExpansionKind into AtomicExpansionKind (done in a separate patch, for readability).

In addition to being IMO clearer, this gives TLI more flexibility when deciding which loads/cmpxchgs to expand, and how.

If folks think this is a positive change, I'll update the other backends before committing.  Thanks!

http://reviews.llvm.org/D12557

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/AtomicExpandPass.cpp
  lib/Target/AArch64/AArch64ISelLowering.cpp
  lib/Target/AArch64/AArch64ISelLowering.h
  lib/Target/ARM/ARMISelLowering.cpp
  lib/Target/ARM/ARMISelLowering.h
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12557.33814.patch
Type: text/x-patch
Size: 12621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150902/f8149b7f/attachment.bin>


More information about the llvm-commits mailing list