[PATCH] D46658: [InstCombine] Unify handling of atomic memtransfer with non-atomic memtransfer

Daniel Neilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 12:14:11 PDT 2018


dneilson created this revision.
dneilson added reviewers: apilipenko, skatkov, mkazantsev, anna.

This change reworks the handling of atomic memcpy within the instcombine pass.
Previously, a constant length atomic memcpy would be lowered into loads & stores
as long as no more than 16 load/store pairs are created. This is quite different
from the lowering done for a non-atomic memcpy; which only ever lowers into a single
load/store pair of no more than 8 bytes. Larger constant-sized memcpy calls are
expanded to load/stores in later passes, such as SelectionDAG lowering.

In this change the behaviour for atomic memcpy is unified with non-atomic memcpy;
atomic memcpy is now treated in the same was as non-atomic memcpy has always been.
We leave it to later passes to lower longer-length atomic memcpy calls.

Due to the structure of the pass's handling of memtransfer intrinsics, this change
also gives us handling of atomic memmove that we did not previously have.


Repository:
  rL LLVM

https://reviews.llvm.org/D46658

Files:
  lib/Transforms/InstCombine/InstCombineCalls.cpp
  lib/Transforms/InstCombine/InstCombineInternal.h
  test/Transforms/InstCombine/element-atomic-memcpy-to-loads.ll
  test/Transforms/InstCombine/element-atomic-memintrins.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46658.145982.patch
Type: text/x-patch
Size: 28714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180509/d800f9be/attachment.bin>


More information about the llvm-commits mailing list