[all-commits] [llvm/llvm-project] 630b95: [mlir][math] Add constant folding for math.rsqrt (...

Ian Wood via All-commits all-commits at lists.llvm.org
Tue Mar 3 15:50:31 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 630b9570d199dca19dc85834f583bc8590a21876
      https://github.com/llvm/llvm-project/commit/630b9570d199dca19dc85834f583bc8590a21876
  Author: Ian Wood <ianwood2024 at u.northwestern.edu>
  Date:   2026-03-03 (Tue, 03 Mar 2026)

  Changed paths:
    M mlir/include/mlir/Dialect/Math/IR/MathOps.td
    M mlir/lib/Dialect/Math/IR/MathOps.cpp
    M mlir/test/Dialect/Math/canonicalize.mlir

  Log Message:
  -----------
  [mlir][math] Add constant folding for math.rsqrt (#184443)

Add a fold() method to RsqrtOp, matching the pattern used by SqrtOp and
other math unary ops. The fold computes `1.0 / sqrt(x)` using APFloat
division.

---------

Signed-off-by: Ian Wood <ianwood at u.northwestern.edu>



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