[PATCH] Refactor AtomicExpandPass and add a generic isAtomic() method to Instruction

Robin Morisset morisset at google.com
Fri Aug 22 17:42:44 PDT 2014


Hi jfb,

Split shouldExpandAtomicInIR() into different versions for Stores/Loads/RMWs/CmpXchgs.
Makes runOnFunction cleaner (no more redundant checking/casting), and will help moving
the X86 backend to this pass.

This requires a way of easily detecting which instructions are atomic.
I followed the pattern of mayReadFromMemory, mayWriteOrReadMemory, etc.. in making
isAtomic() a method of Instruction implemented by a switch on the opcodes.

http://reviews.llvm.org/D5035

Files:
  include/llvm/IR/Instruction.h
  include/llvm/IR/Instructions.h
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/AtomicExpandPass.cpp
  lib/IR/Instruction.cpp
  lib/Target/AArch64/AArch64ISelLowering.cpp
  lib/Target/AArch64/AArch64ISelLowering.h
  lib/Target/ARM/ARMISelLowering.cpp
  lib/Target/ARM/ARMISelLowering.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5035.12870.patch
Type: text/x-patch
Size: 14003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140823/cee46c59/attachment.bin>


More information about the llvm-commits mailing list