[llvm-bugs] [Bug 49147] New: [FastMath] Failure to fold 1 / powf(x, y) -> powf(x, -y)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 11 06:30:21 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49147

            Bug ID: 49147
           Summary: [FastMath] Failure to fold 1 / powf(x,y) -> powf(x,
                    -y)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org

#include <cmath>

float invpow_i(float x, int y) {
    return 1.0f / __builtin_powf(x, y);
}
float invpow_f(float x, float y) {
    return 1.0f / __builtin_powf(x, y);
}

https://simd.godbolt.org/z/YxaW96

Clang fails to merge the fdiv into the pow by negating the exponent arg

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210211/6a17ba26/attachment.html>


More information about the llvm-bugs mailing list