[llvm-dev] LLVM v3.9.0 and math built-ins

Martin J. O'Riordan via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 21 02:44:01 PDT 2016


Thanks Eli,

 

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.

 

All the best,

 

            MartinO

 

From: Friedman, Eli [mailto:efriedma at codeaurora.org] 
Sent: 20 September 2016 18:14
To: Martin J. O'Riordan <martin.oriordan at movidius.com>; mehdi.amini at apple.com
Cc: 'LLVM Developers' <llvm-dev at lists.llvm.org>
Subject: Re: [llvm-dev] LLVM v3.9.0 and math built-ins

 

On 9/20/2016 4:12 AM, Martin J. O'Riordan via llvm-dev wrote:

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:

 

(void)exp(1.0);

return 0;

 

  %1 = tail call float @exp(float 1.000000e+00)

 

; Function Attrs: readnone

declare float @exp(float) local_unnamed_addr #1


You have to set readonly on the call, not the function ("tail call float @exp(float 1.000000e+00) readonly") ; the attributes on a function declaration are generally ignored by LLVM.


For the difference between 3.8 and 3.9, see https://llvm.org/bugs/show_bug.cgi?id=30464 .

-Eli



-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160921/67170627/attachment.html>


More information about the llvm-dev mailing list