[PATCH] D58242: Teach instcombine about remaining idemptotent atomicrmw types

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 14 09:27:00 PST 2019


reames created this revision.
reames added reviewers: qcolombet, jfb, spatel, majnemer.
Herald added subscribers: jdoerfert, bollu, mcrosier.

Expand on Quentin's r353471 patch which converts some atomicrmws into loads.  Handle remaining operation types, and fix a slight bug.  Atomic loads are required to have alignment.  Since this was within the InstCombine fixed point, somewhere else in InstCombine was adding alignment before the verifier saw it, but still, we should fix.

Terminology wise, I'm using the "idempotent" naming that is used for the same operations in AtomicExpand and X86ISelLoweringInfo.  Once this lands, I'll add similar tests for AtomicExpand, and move the pattern match function to a common location.  Any suggestions as to where?

The last thing we should probably do - not in this patch - is to canonicalize the operation for any idempotent atomicrmw which we can't convert to a load.  I was thinking to have "atomicrmw or, ptr, 0" be the canonical choice.  Thoughts?


https://reviews.llvm.org/D58242

Files:
  lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp
  test/Transforms/InstCombine/atomicrmw.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58242.186858.patch
Type: text/x-patch
Size: 6122 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190214/16dc82e6/attachment-0001.bin>


More information about the llvm-commits mailing list