<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 18, 2018, at 7:45 AM, Daniel Neilson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">

<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class=""><br class="">
</div>
Hi all,
<div class=""> This change has been reviewed, and appears to be ready to land (review available here if anyone still wants to chime in:
<a href="https://reviews.llvm.org/D41675" class="">https://reviews.llvm.org/D41675</a> ). The process that we’re going to use for landing this will take a few steps. To wit:</div>
<div class=""><br class="">
</div>
<div class="">Step 1) Remove align argument, and add align attribute to pointer args. </div></div></div></blockquote><div><br class=""></div><div>What does this mean? Are you suggesting that alignment become part of PointerType?  That would introduce lots of problems, because unaligned and aligned pointers would require casts, which then interfere with optimizations.</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Require that src & dest have the same alignment via verifier rule.  Also update Clang & Polly tests to pattern-match the new form.</div>
<div class="">Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing source and dest alignments.<br class="">
Step 3) Update Clang to use the new IRBuilder API.<br class="">
Step 4) Update Polly to use the new IRBuilder API.<br class="">
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  getDestAlignment() and getSourceAlignment() instead.<br class="">
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the MemIntrinsicInst::[get|set]Alignment() methods.</div>
<div class=""><br class="">
</div>
<div class=""> Unless there are objections, I would like to land step 1 tomorrow (Friday Jan 19) morning. My hope is to be completing up to step 4 by the middle of next week, and then steps 5 & 6 in the coming weeks.</div>
<div class=""><br class="">
</div>
<div class=""> Landing step 1 will potentially have a large impact on downstream consumer’s tests. For example, a front-end that checks IR generation of constructs implemented using memcpy/memmove/memset; the Clang tests for OpenMP firstprivate/lastprivate
 clauses, for instance, required a lot of manual updating. These sorts of tests will need to be updated to match the new pattern printed for the memory intrinsics. I’ve included an extended sed script in the commit log that can update many patterns, but definitely
 does not catch them all so some manual updating will be required.</div>
<div class=""><br class="">
</div>
<div class="">-Daniel</div>
<div class=""><br class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
---</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
Daniel Neilson, Ph.D.</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
Azul Systems</div>
</div>
</div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Jan 2, 2018, at 2:11 PM, Daniel Neilson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class="">Good day all,</div>
<div class=""> I’ve spent a few days resurrecting the circa-2015 work on removing the explicit alignment argument (4th arg) from the @llvm.memcpy/memmove/memset intrinsics in favour of using the alignment attribute on the pointer args of calls to the intrinsic.
 This work was first proposed back in August 2015 by Lang Hames:</div>
<div class=""><a href="http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html" class="">http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html</a>   (item 2)</div>
<div class=""> and an attempt at landing the work was made by Pete Cooper in November 2015, but then backed out due to unspecified bot failures:</div>
<div class=""><a href="http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html" class="">http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html</a></div>
<div class=""><br class="">
</div>
<div class=""> I’ve prepared changes for LLVM, Clang, and Polly that are now up for review:</div>
<div class="">* <a href="https://reviews.llvm.org/D41675" class="">https://reviews.llvm.org/D41675</a>   (LLVM part)</div>
<div class="">* <a href="https://reviews.llvm.org/D41676" class="">https://reviews.llvm.org/D41676</a>   (polly part)</div>
<div class="">* <a href="https://reviews.llvm.org/D41677" class="">https://reviews.llvm.org/D41677</a>   (Clang part)</div>
<div class=""><br class="">
</div>
<div class=""> Importantly for those maintaining downstream users of the LLVM API, this changes the prototypes for the @llvm.memcpy/memmove/memset intrinsics and changes the IRBuilder API for creating memcpy and memmove calls.</div>
<div class=""><br class="">
</div>
<div class="">For example, IR which used to read:<br class="">
     call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)<br class="">
will now read<br class="">
     call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)</div>
<div class=""><br class="">
</div>
 The LLVM change includes auto upgrade of the old IR. However, match expressions in IR tests and calls to IRBuilder’s CreateMemCpy & CreateMemMove will need to be updated.
<div class=""><br class="">
</div>
<div class=""> My plan is to post another note to the list when the change is landed, and stable.</div>
<div class=""><br class="">
</div>
<div class=""> Comments? Concerns?</div>
<div class=""><br class="">
</div>
<div class="">-Daniel<br class="">
<div class=""><br class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
---</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
Daniel Neilson, Ph.D.</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
Azul Systems</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="">
</div>
<br class="Apple-interchange-newline">
</div>
<br class="Apple-interchange-newline">
</div>
<br class="">
</div>
</div>
</div>
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>

_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>