[llvm] [InstCombine] Add log-pow simplification for FP exponent edge case. (PR #76641)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 07:43:03 PST 2024
================
@@ -34,6 +34,38 @@ define double @log_powi_nonconst(double %x, i32 %y) {
ret double %log
}
+define float @logf_powfi_const(float %x) {
+; CHECK-LABEL: @logf_powfi_const(
+; CHECK-NEXT: [[LOG1:%.*]] = call fast float @llvm.log.f32(float [[X:%.*]])
+; CHECK-NEXT: [[MUL:%.*]] = fmul fast float [[LOG1]], -3.000000e+00
+; CHECK-NEXT: ret float [[MUL]]
+ %pow = call fast float @llvm.powi.f32.i32(float %x, i32 -3)
+ %log = call fast float @logf(float %pow)
----------------
tanmaysachan wrote:
Added a test with explicit calls to both.
https://github.com/llvm/llvm-project/pull/76641
More information about the llvm-commits
mailing list