[llvm-commits] [llvm-gcc-4.2] r55796 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Fri Sep 5 01:11:24 PDT 2008


Hi Dale,

> Use new math intrinsics only when errno is not in use.
> They are marked as not touching memory.

this is not enough.  Some gcc math builtins may be marked
readonly, not readnone (= does not touch memory).  It is
then wrong to promote them to the readnone llvm intrinsics.
Please replace the errno test with a check something like
this:

if (flags_from_decl_or_type(exp) & ECF_CONST)

This will automatically handle the errno case.

Thanks,

Duncan.

PS: gcc marks some math functions readonly ("pure") if
their result depends on the floating point rounding mode.
This is correct, and it would be wrong to promote to
readnone in this case.



More information about the llvm-commits mailing list