[llvm-commits] [PATCH] Ensure log2/exp2 are only intrinsic-ified if declared readnone

James Molloy James.Molloy at arm.com
Thu Mar 1 06:39:33 PST 2012


r151807. Cheers Chris!

-----Original Message-----
From: Chris Lattner [mailto:clattner at apple.com]
Sent: 01 March 2012 13:39
To: James Molloy
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] [PATCH] Ensure log2/exp2 are only intrinsic-ified if declared readnone


On Mar 1, 2012, at 4:06 AM, James Molloy wrote:

> Hi,
>
> The attached patch fixes a codegen fault in which log2 and exp2 were being
> converted to intrinsic when they weren't declared as "readnone".
>
> The problem is that these functions can set errno, and the intrinsics don't
> model sideeffects so can be dead-code eliminated if not used.
>
> Sinf/cosf have similar sideeffects, and this is already modelled by an extra
> check to see if they are declared "readnone" before conversion to
> intrinsics. I've added this check to log2/exp2.
>
> It's pretty simple (and comes with testcases) - am I OK to commit?

Looks good to me, please do!

-Chris



-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.





More information about the llvm-commits mailing list