[llvm-dev] Comparing results of math function calls

Dávid Bolvanský via llvm-dev llvm-dev at lists.llvm.org
Wed May 23 16:48:15 PDT 2018


Hello,

Code:

int f1(int a, int b) {
    return sqrt(a) > sqrt(b);
}

int f2(int a, int b) {
    return a > b;
}

Possibly, under -ffast-math (to ignore NaNs), f1 could be transformed to f2
variant.

Also a transformation could support sin and tan, and reverse comparison for
cos.

Suggestions?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180524/042a317a/attachment.html>


More information about the llvm-dev mailing list