Fixed build of D81618
Add a pattern for expanding tanh op into exp form.
A tanh is expanded into:
- 1-exp^{-2x} / 1+exp^{-2x}, if x => 0
- exp^{2x}-1 / exp^{2x}+1 , if x < 0.
Paths
| Differential D82040
[mlir] Add support for expanding tanh op into exp form. ClosedPublic Authored by hanchung on Jun 17 2020, 12:13 PM.
Details Summary Fixed build of D81618 Add a pattern for expanding tanh op into exp form.
Diff Detail
Event TimelineComment Actions It's fixed by adding a missing dep in mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt Comment Actions Oh wait me a sec, I think I should populate the pattern at populateStdToLLVMConversionPatterns, not in LinalgToLLVM.cpp file. Let me fix it. hanchung retitled this revision from [mlir] Add support for lowering tanh to LLVMIR. to [mlir] Add support for expanding tanh op into exp form..Jun 17 2020, 12:39 PM This revision is now accepted and ready to land.Jun 18 2020, 5:20 AM Closed by commit rG9cb10296ecaa: [mlir] Add support for lowering tanh to LLVMIR. (authored by hanchung). · Explain WhyJun 18 2020, 10:54 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 271453 mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h
mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp
mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
mlir/lib/Dialect/StandardOps/Transforms/ExpandTanh.cpp
mlir/test/Dialect/Standard/expand-tanh.mlir
mlir/test/lib/Transforms/CMakeLists.txt
mlir/test/lib/Transforms/TestExpandTanh.cpp
mlir/tools/mlir-opt/mlir-opt.cpp
|