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

James Molloy james.molloy at arm.com
Thu Mar 1 04:06:21 PST 2012


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?

Cheers,

James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log2_exp2.patch
Type: application/octet-stream
Size: 3139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120301/f4c8567d/attachment.obj>


More information about the llvm-commits mailing list