<div dir="ltr">IRBuilder::CreateMemCpy worked great, thanks!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 22, 2018 at 6:32 PM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 3/22/2018 3:15 PM, Andrew Kelley via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The new @llvm.memcpy API does not have an alignment parameter. Instead the docs say to use the align <n> attribute. How is this supposed to work with different alignments?<br>
<br>
For example, I have one memcpy with align 4, align 4, and another with align 1, align 1.<br>
<br>
; Function Attrs: argmemonly nounwind<br>
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly align 4, i8* nocapture readonly align 4, i64, i1) #3<br>
<br>
; Function Attrs: argmemonly nounwind<br>
declare void @llvm.memcpy.p0i8.p0i8.i64.1(i<wbr>8* nocapture writeonly align 1, i8* nocapture readonly align 1, i64, i1) #3<br>
<br>
<br>
When I add these multiple definitions to the module, llvm mangles the name, adding `.1` to the second one, and I get "Intrinsic name not mangled correctly for type arguments!"<br>
<br>
What's the correct way to do this?<br>
</blockquote>
<br></span>
You're not supposed to add the alignment to the function declaration; just add it to the call itself. (If you're using IRBuilder, CreateMemCpy will take care of this for you.)<span class="HOEnZb"><font color="#888888"><br>
<br>
-Eli<br>
<br>
-- <br>
Employee of Qualcomm Innovation Center, Inc.<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br>
<br>
</font></span></blockquote></div><br></div>