Christoph,<br><br> Yes, you are correct on the lifetime calls, they are just markers for liveness.<br><br>However, the backend is not optimizing these calls away. I could try to deal with them outside of llvm but I was hoping for a cleaner solution using llvm?<br>
<br><div class="gmail_quote">On Mon, Mar 5, 2012 at 11:51 AM, Christoph Erhardt <span dir="ltr"><<a href="mailto:christoph@sicherha.de">christoph@sicherha.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Ryan,<br>
<br>
the compiler is free to insert implicit calls to memcpy(), for instance<br>
for assignments from one struct/class variable to another. The same goes<br>
for memset(), which may be inserted implicitly for the initialization of<br>
local structs or arrays.<br>
<br>
The good news is that the backend normally optimizes these calls away<br>
where possible, replacing them with simple moves - at least as long as<br>
the number of bytes to copy does not exceed a certain threshold.<br>
<br>
As for the llvm.lifetime intrinsics, take a look at the documentation:<br>
<a href="http://llvm.org/docs/LangRef.html#int_memorymarkers" target="_blank">http://llvm.org/docs/LangRef.html#int_memorymarkers</a><br>
If I'm not mistaken, these calls seem to be used to mark the lifespan of<br>
a stack-allocated object.<br>
<br>
Regards,<br>
Christoph<br>
</blockquote></div><br>