<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear Sanjoy Das and community.</p>
<p><br>
</p>
<p>I was tried to fix a bug in the pass InitAllocas from SAFECode. This is a function pass and will insert a prototype of '<span>llvm.memset.p0i8.i32' in the module at doInitialize() stage of the pass. But, this prototype will be eliminated by strip unused
 function optimization since there is no call on this function after doInitialization(). Therefore there will be no prototype at the runOnFunction() stage, and this will cause a fail. Previously I solve this kind of bug by inserting the prototype of the function
 to llvm.compiler.used. In this way, the compiler will not leave the prototype alone. This time, the situation is a bit complicated, inserting the intrinsic function to llvm.compiler.used will cause a fail because only users of direct call/invokes are allowed
 on intrinsic functions.</span></p>
<p><span><br>
</span></p>
<p><span>Fortunately, after some discussion with my GSoC mentor, Prof. Criswell, we chose to rewrite the pass to a module pass, this solves this issue perfectly. Thanks for your patience.</span></p>
<p><span><br>
</span></p>
<p><span>Best regards,</span></p>
<p>Zhengyang.</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Sanjoy Das <sanjoy@playingwithpointers.com><br>
<b>Sent:</b> Thursday, June 23, 2016 3:44:09 PM<br>
<b>To:</b> Zhengyang Liu<br>
<b>Cc:</b> llvm-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] How can I make llvm intrinsic functions declarations survive from optimizations.</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi Zhengyang,<br>
<br>
Do you mind sharing _why_ you need the intrinsic declarations to stay<br>
around?  It is possible that there is a better way of solving your<br>
problem.<br>
<br>
Thanks!<br>
-- Sanjoy<br>
</div>
</span></font>
</body>
</html>