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: unassignedb...@nondot.org
          Reporter: llvm-...@redking.me.uk
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to