Skip to content

Commit

Permalink
Change memcpy/memove/memset to have dest and source alignment attribu…
Browse files Browse the repository at this point in the history
…tes.

Summary:
  This change is step four in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. Steps:

Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

Reviewers: jdoerfert, grosser, bollu

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D41677

llvm-svn: 323618
  • Loading branch information
Daniel Neilson committed Jan 28, 2018
1 parent c8bdc8d commit 77a9836
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion polly/include/polly/Support/ScopHelper.h
Expand Up @@ -198,8 +198,11 @@ class MemAccInst {
return asLoad()->getAlignment();
if (isStore())
return asStore()->getAlignment();
if (isMemTransferInst())
return std::min(asMemTransferInst()->getDestAlignment(),
asMemTransferInst()->getSourceAlignment());
if (isMemIntrinsic())
return asMemIntrinsic()->getAlignment();
return asMemIntrinsic()->getDestAlignment();
if (isCallInst())
return 0;
llvm_unreachable("Operation not supported on nullptr");
Expand Down

0 comments on commit 77a9836

Please sign in to comment.