<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Book Antiqua",serif;
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Book Antiqua",serif;
        color:#993366;
        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]--></head><body bgcolor=white lang=EN-IE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#993366;mso-fareast-language:EN-US'>Thanks Eli,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#993366;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#993366;mso-fareast-language:EN-US'>My edits are just experiments to see if I could fix it, but I am not familiar with this area of the code and my approach is inevitably naïve.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#993366;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#993366;mso-fareast-language:EN-US'>All the best,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#993366;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#993366;mso-fareast-language:EN-US'>            MartinO<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#993366;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'> Friedman, Eli [mailto:efriedma@codeaurora.org] <br><b>Sent:</b> 20 September 2016 18:14<br><b>To:</b> Martin J. O'Riordan <martin.oriordan@movidius.com>; mehdi.amini@apple.com<br><b>Cc:</b> 'LLVM Developers' <llvm-dev@lists.llvm.org><br><b>Subject:</b> Re: [llvm-dev] LLVM v3.9.0 and math built-ins<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On 9/20/2016 4:12 AM, Martin J. O'Riordan via llvm-dev wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>I modified my sources to force ‘readnone’ and even tried ‘setDoesNotAccessMemory()’ on the math functions, but this still results in one call occurring and the code generated is effectively:<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>(void)exp(1.0);<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>return 0;<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:10.0pt'>  %1 = tail call float @exp(float 1.000000e+00)</span><o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:10.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:10.0pt'>; Function Attrs: readnone</span><o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:10.0pt'>declare float @exp(float) local_unnamed_addr #1</span><o:p></o:p></p></blockquote><p class=MsoNormal><br>You have to set readonly on the call, not the function ("<span style='font-size:10.0pt'>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 href="https://llvm.org/bugs/show_bug.cgi?id=30464">https://llvm.org/bugs/show_bug.cgi?id=30464</a> .<br><br>-Eli<br><br><o:p></o:p></p><pre>-- <o:p></o:p></pre><pre>Employee of Qualcomm Innovation Center, Inc.<o:p></o:p></pre><pre>Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<o:p></o:p></pre></div></body></html>