[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 05:12:26 PST 2024


================
@@ -12,6 +12,28 @@ define double @log_pow(double %x, double %y) {
   ret double %log
 }
 
+define double @log_powi_const(double %x) {
+; CHECK-LABEL: @log_powi_const(
+; CHECK-NEXT:    [[LOG1:%.*]] = call fast double @llvm.log.f64(double [[X:%.*]])
+; CHECK-NEXT:    [[MUL:%.*]] = fmul fast double [[LOG1]], -3.000000e+00
+; CHECK-NEXT:    ret double [[MUL]]
+;
+  %pow = call fast double @llvm.powi.f64.i32(double %x, i32 -3)
+  %log = call fast double @log(double %pow)
----------------
tanmaysachan wrote:

Is there any existing issue about shifting some transformers to non-fast? I could have a look at it.

https://github.com/llvm/llvm-project/pull/76641


More information about the llvm-commits mailing list