[all-commits] [llvm/llvm-project] f66e4b: [mlir][math] Modify math.powf to handle negative b...

Balaji V. Iyer. via All-commits all-commits at lists.llvm.org
Fri Aug 25 15:35:51 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f66e4bd67adf0b0aaecd94154c38f02253bf7190
      https://github.com/llvm/llvm-project/commit/f66e4bd67adf0b0aaecd94154c38f02253bf7190
  Author: Balaji V. Iyer <bviyer at gmail.com>
  Date:   2023-08-25 (Fri, 25 Aug 2023)

  Changed paths:
    M mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp
    M mlir/test/Dialect/Math/expand-math.mlir
    M mlir/test/mlir-cpu-runner/test-expand-math-approx.mlir

  Log Message:
  -----------
  [mlir][math] Modify math.powf to handle negative bases.

Powf expansion currently returns NaN when the base is negative.
This is because taking natural log of a negative number gives
NaN. This patch will square the base and half the exponent, thereby
getting around the negative base problem.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D158797




More information about the All-commits mailing list