This is an archive of the discontinued LLVM Phabricator instance.

[mlir][math] Added basic support for FPowI operation.
ClosedPublic

Authored by vzakhari on Jul 14 2022, 3:28 PM.

Details

Summary

The operation computes pow(b, p), where 'b' is floating point
and 'p' is a signed integer. The result's type matches 'b' type.
The operands must have the same shape.

Diff Detail

Event Timeline

vzakhari created this revision.Jul 14 2022, 3:28 PM
vzakhari requested review of this revision.Jul 14 2022, 3:28 PM
vzakhari updated this revision to Diff 445031.Jul 15 2022, 9:44 AM
vzakhari updated this revision to Diff 445348.Jul 17 2022, 1:54 PM
vzakhari updated this revision to Diff 446942.Jul 22 2022, 12:31 PM
vzakhari retitled this revision from [mlir][math] Added basic support for FPowSI operation. to [mlir][math] Added basic support for FPowI operation..
vzakhari updated this revision to Diff 449431.Aug 2 2022, 2:04 PM

rebase

Please review.

Mogball requested changes to this revision.Aug 11 2022, 10:17 AM
Mogball added a subscriber: Mogball.
Mogball added inline comments.
mlir/lib/Dialect/Math/Transforms/AlgebraicSimplification.cpp
122

please remove this. this is in an implementation file

128

can you pass in the mul and div op types as template arguments?

This revision now requires changes to proceed.Aug 11 2022, 10:17 AM
vzakhari updated this revision to Diff 452777.Aug 15 2022, 12:26 PM

Addressed review comments. This includes rebase - sorry for the inconvenience.

Mogball added inline comments.Aug 15 2022, 2:24 PM
mlir/include/mlir/Dialect/Math/IR/MathOps.td
779–780

Can you use AllTypesMatch<["lhs", "result"]> instead?

813

the result type can be omitted from the assembly format since it matches the type of lhs

$lhs `,` $rhs attr-dict `:` type($lhs) `,` type($rhs)
mlir/lib/Dialect/Math/Transforms/AlgebraicSimplification.cpp
166–175
vzakhari added inline comments.Aug 15 2022, 4:43 PM
mlir/include/mlir/Dialect/Math/IR/MathOps.td
779–780

Will do. Thanks!

813

Thanks!

mlir/lib/Dialect/Math/Transforms/AlgebraicSimplification.cpp
166–175

Okay. Will do.

vzakhari updated this revision to Diff 452847.Aug 15 2022, 4:44 PM
Mogball accepted this revision.Aug 16 2022, 8:51 AM

LGTM just some doc formatting nits

mlir/include/mlir/Dialect/Math/IR/MathOps.td
791–792
795–797
This revision is now accepted and ready to land.Aug 16 2022, 8:51 AM

LGTM just some doc formatting nits

Thank you for the review! I will apply the formatting changes before merging.

This revision was automatically updated to reflect the committed changes.