<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>
<blockquote type="cite" class="">
<div class="">On Jan 18, 2018, at 10:48 PM, Chris Lattner <<a href="mailto:clattner@nondot.org" class="">clattner@nondot.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><br class="Apple-interchange-newline">
<br class="" 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;">
<blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">
<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="">
<div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<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:<span class="Apple-converted-space"> </span><a href="https://reviews.llvm.org/D41675" class="">https://reviews.llvm.org/D41675</a><span class="Apple-converted-space"> </span>).
 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.<span class="Apple-converted-space"> </span></div>
</div>
</div>
</blockquote>
<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>
<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="">
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>
</blockquote>
<div><br class="">
</div>
<div>Bad communication on my part; perhaps, I used non-standard terminology to refer to a CallInst’s parameter attributes. I am not touching the definition of PointerType in any way; I don’t see the need, and I’m not that ambitious. ;-) Currently, a call to
 @llvm.memcpy might look like this:</div>
<div><br class="">
</div>
<div>  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)</div>
<div><br class="">
</div>
<div>where the ‘i32 4’ argument (2nd last arg) is the minimum alignment of both of the pointer args (%src & %dest). After this change, this same call will instead read:</div>
<div><br class="">
</div>
<div>  call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)</div>
<div><br class="">
</div>
<div>where we use an align attribute on first two function-call arguments. (i.e CallInst::addParamAttr(0, …) & CallInst::addParamAttr(1, …))</div>
<div><br class="">
</div>
<div> That is all that this first step is doing. With the caveat that we, temporarily (basically for the purposes of testing the initial change), will require that the alignment attribute on both of the pointer args be the same value. So, nothing like this
 for now:</div>
<div><br class="">
</div>
<div>  call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 16 %dest, i8* align 4 %src, i32 100, i1 false)</div>
<div><br class="">
</div>
</div>
 The alignments-equal restriction will be lifted in step 2, which should happen next week.
<div class=""><br class="">
</div>
<div class=""> Is that clearer?</div>
<div class=""><br class="">
</div>
<div class="">-Daniel</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div>---</div>
<div>Daniel Neilson, Ph.D.</div>
<div>Azul Systems</div>
<div class=""><br class="">
</div>
</div>
</div>
</div>
</body>
</html>