This is an archive of the discontinued LLVM Phabricator instance.

[mlir][complex] Lowering complex.tanh to standard
ClosedPublic

Authored by Lewuathe on May 26 2022, 10:40 PM.

Details

Summary

Lowering complex.tanh to standard dialects including math, arith.

Diff Detail

Event Timeline

Lewuathe created this revision.May 26 2022, 10:40 PM
Lewuathe requested review of this revision.May 26 2022, 10:40 PM
Lewuathe retitled this revision from Lowering complex.tanh to standard to [mlir][complex] Lowering complex.tanh to standard.
pifon2a accepted this revision.May 27 2022, 2:32 AM
pifon2a added inline comments.
mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
732

please, add a comment about what you're actually computing here and, if possible, where did you take it from.

Here you are computing

tanh(x + i * y) = (tanh(x) + i * tan(y)) / (1 + tanh(x) * tan(y))
749

Please, introduce TanOp for complex numbers that expands as sin/cos. Not necessarily in this patch.

This revision is now accepted and ready to land.May 27 2022, 2:32 AM
Lewuathe updated this revision to Diff 432834.May 29 2022, 11:09 PM

Add comment describing hyperbolic tangent calculation for complex numbers.

Lewuathe updated this revision to Diff 432835.May 29 2022, 11:11 PM

Add comment for tanh for complex numbers.

Lewuathe marked an inline comment as done.May 29 2022, 11:14 PM

@Harbormaster Thank you for the review. I'm going to prepare the patch for general tan operation for a complex number. Could you land this patch on behalf of me because I do not have permission to do so.

Lewuathe updated this revision to Diff 433236.May 31 2022, 5:07 PM

Apply clang-format

@pifon2a Thank you for the review. I fixed the format issue and now all CI seems green. Could you push the patch into the repository because I don't have permission to do so.

This revision was automatically updated to reflect the committed changes.