[all-commits] [llvm/llvm-project] a92e3d: [mlir][math] Fix `math.powf` expansion case for `p...

Christopher Bate via All-commits all-commits at lists.llvm.org
Mon Dec 9 13:53:17 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a92e3df3007a323b5434c6cf301e15e01a642a70
      https://github.com/llvm/llvm-project/commit/a92e3df3007a323b5434c6cf301e15e01a642a70
  Author: Christopher Bate <cbate at nvidia.com>
  Date:   2024-12-09 (Mon, 09 Dec 2024)

  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] Fix `math.powf` expansion case for `pow(x, 0)` (#119015)

Lowering `math.powf` to `llvm.intr.powf` will result in `pow(x, 0) =
1`, even for `x=0`. When using the Math dialect expansion patterns,
`pow(0, 0)` will result in `-nan`, however, This change adds two
additional instructions to the lowering to ensure the `pow(x, 0)` case
lowers to to `1` regardless of the value of `x`.

Resolves https://github.com/llvm/llvm-project/issues/118945.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list