This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Math] Add constant folder for Log1pOp.
ClosedPublic

Authored by jacquesguan on Jul 17 2022, 7:39 PM.

Details

Summary

This patch adds constant folder for Log1pOp which only supports single and double precision floating-point.

Diff Detail

Event Timeline

jacquesguan created this revision.Jul 17 2022, 7:39 PM
jacquesguan requested review of this revision.Jul 17 2022, 7:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2022, 7:39 PM
bondhugula added inline comments.Jul 17 2022, 9:20 PM
mlir/lib/Dialect/Math/IR/MathOps.cpp
138

This requires a comment. The log1p function wouldn't be defined for any number <= -1 since 1 + x <= 0. Trying to understand why this check is just for all negative a as opposed to a <= -1?

Mogball accepted this revision.Jul 18 2022, 12:36 AM

Lgtm but please address uday's comment

This revision is now accepted and ready to land.Jul 18 2022, 12:36 AM

Address comment.

jacquesguan marked an inline comment as done.Jul 18 2022, 7:52 PM
jacquesguan added inline comments.
mlir/lib/Dialect/Math/IR/MathOps.cpp
138

Done, thanks.

This revision was automatically updated to reflect the committed changes.
jacquesguan marked an inline comment as done.