[all-commits] [llvm/llvm-project] 9cb102: [mlir] Add support for lowering tanh to LLVMIR.

Han-Chung Wang via All-commits all-commits at lists.llvm.org
Thu Jun 18 10:42:37 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9cb10296ecaa2d7131744375e8b14200674fa1e5
      https://github.com/llvm/llvm-project/commit/9cb10296ecaa2d7131744375e8b14200674fa1e5
  Author: Hanhan Wang <hanchung at google.com>
  Date:   2020-06-18 (Thu, 18 Jun 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h
    M mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/StandardOps/Transforms/ExpandTanh.cpp
    A mlir/test/Dialect/Standard/expand-tanh.mlir
    M mlir/test/lib/Transforms/CMakeLists.txt
    A mlir/test/lib/Transforms/TestExpandTanh.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir] Add support for lowering tanh to LLVMIR.

Summary:
Fixed build of D81618

Add a pattern for expanding tanh op into exp form.
A `tanh` is expanded into:
   1) 1-exp^{-2x} / 1+exp^{-2x}, if x => 0
   2) exp^{2x}-1 / exp^{2x}+1  , if x < 0.

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




More information about the All-commits mailing list