This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add support for non-f32 polynomial approximation
ClosedPublic

Authored by rsuderman on Mar 22 2023, 5:38 PM.

Details

Summary

Polynomial approximations assume F32 values. We can convert all non-f32
cases to operate on f32s with intermediate casts.

Diff Detail

Event Timeline

rsuderman created this revision.Mar 22 2023, 5:38 PM
rsuderman requested review of this revision.Mar 22 2023, 5:38 PM
rsuderman retitled this revision from Add support for non-f32 polynomial approximation to [mlir] Add support for non-f32 polynomial approximation.Mar 22 2023, 5:38 PM
rsuderman edited reviewers, added: jpienaar; removed: nicolasvasilache.
jpienaar added inline comments.Mar 22 2023, 5:43 PM
mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
1398

Where did false case go?

rsuderman marked an inline comment as done.Mar 22 2023, 5:48 PM
rsuderman added inline comments.
mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
1398

Look on the next line? :)

Removing the Reuse patterns pushed to the next line. Though I should probably add one for Rsqrt approximation.

rsuderman updated this revision to Diff 507566.Mar 22 2023, 5:58 PM
rsuderman marked an inline comment as done.

Added math.rsqrt lowering

jpienaar accepted this revision.Mar 24 2023, 6:59 PM
This revision is now accepted and ready to land.Mar 24 2023, 6:59 PM
This revision was landed with ongoing or failed builds.Mar 27 2023, 2:58 PM
This revision was automatically updated to reflect the committed changes.