[llvm] [InstCombine] Add log-pow simplification for FP exponent edge case. (PR #76641)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 01:33:21 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)
----------------
arsenm wrote:
Requiring fast for this transform seems like overkill, but that's a pre-existing issue that could be relaxed
https://github.com/llvm/llvm-project/pull/76641
More information about the llvm-commits
mailing list