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

Han-Chung Wang via All-commits all-commits at lists.llvm.org
Mon Jun 15 10:29:57 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 32c757e4f808c68a7e34eb712fead0a49cdf814a
      https://github.com/llvm/llvm-project/commit/32c757e4f808c68a7e34eb712fead0a49cdf814a
  Author: Hanhan Wang <hanchung at google.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h
    M mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp
    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:
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/D81618




More information about the All-commits mailing list