[llvm-commits] [llvm-gcc-4.0]Patch to make llvm-gcc emit llvm.pow/sin/cos.* [for review]

Duncan Sands baldrick at free.fr
Fri Nov 23 03:52:22 PST 2007


> If you compile it with -fno-math-errno then pow gets declared as
> 
> declare double @pow(double, double) nounwind readonly
> 
> [I'm not sure why it is marked readonly rather than readnone].

PS: it seems that it is marked readonly because the result depends
on the floating point rounding mode, i.e. pow can be considered
to read to (global) rounding mode.  If you compile with -ffast-math
then pow is declared readnone.  This sort of subtle distinction
seems quite important to me, and I'm not sure LLVM was making it
before.



More information about the llvm-commits mailing list