<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 9/20/2016 4:12 AM, Martin J.
O'Riordan via llvm-dev wrote:<br>
</div>
<blockquote cite="mid:000801d2132f$e4b65170$ae22f450$@movidius.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Book Antiqua";
panose-1:2 4 6 2 5 3 5 3 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Book Antiqua",serif;
color:#1F497D;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Book
Antiqua",serif;color:#1F497D;mso-fareast-language:EN-US">I
modified my sources to force ‘</span><span
style="font-family:"Courier
New";color:black;mso-fareast-language:EN-US">readnone</span><span
style="font-family:"Book
Antiqua",serif;color:#1F497D;mso-fareast-language:EN-US">’
and even tried ‘</span><span
style="font-family:"Courier
New";color:black;mso-fareast-language:EN-US">setDoesNotAccessMemory()</span><span
style="font-family:"Book
Antiqua",serif;color:#1F497D;mso-fareast-language:EN-US">’
on the math functions, but this still results in one call
occurring and the code generated is effectively:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Book
Antiqua",serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span
style="font-family:"Courier
New";color:black;mso-fareast-language:EN-US">(void)exp(1.0);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span
style="font-family:"Courier
New";color:black;mso-fareast-language:EN-US">return 0;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Book
Antiqua",serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<span style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-US"><o:p></o:p></span>
<p class="MsoNormal" style="margin-left:36.0pt"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-US"> %1 =
tail call float @exp(float 1.000000e+00)<o:p></o:p></span></p>
<span style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-US"><o:p></o:p></span>
<p class="MsoNormal" style="margin-left:36.0pt"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-US">; Function
Attrs: readnone<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-US">declare
float @exp(float) local_unnamed_addr #1</span></p>
</div>
</blockquote>
<br>
You have to set readonly on the call, not the function ("<span
style="font-size:10.0pt;font-family:"Courier
New";color:black;mso-fareast-language:EN-US">tail call float
@exp(float 1.000000e+00) readonly"</span>) ; the attributes on a
function declaration are generally ignored by LLVM.<br>
<br>
<br>
For the difference between 3.8 and 3.9, see
<a class="moz-txt-link-freetext" href="https://llvm.org/bugs/show_bug.cgi?id=30464">https://llvm.org/bugs/show_bug.cgi?id=30464</a> .<br>
<br>
-Eli<br>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</body>
</html>