This is an archive of the discontinued LLVM Phabricator instance.

[mlir][math] Canonicalization for math.floor op
ClosedPublic

Authored by Lewuathe on Sep 6 2022, 8:14 PM.

Details

Summary

Support constant folding for math.floor op as well as math.ceil.

Diff Detail

Event Timeline

Lewuathe created this revision.Sep 6 2022, 8:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 6 2022, 8:14 PM
Lewuathe requested review of this revision.Sep 6 2022, 8:14 PM
Mogball added inline comments.Sep 6 2022, 8:30 PM
mlir/test/Dialect/Math/canonicalize.mlir
374

This doesn't seem like a useful test

Lewuathe added inline comments.Sep 7 2022, 7:58 PM
mlir/test/Dialect/Math/canonicalize.mlir
374

I thought it might be useful to check not to round if unnecessary as well as @ceil_fold2 does. We don't need both?

Mogball accepted this revision.Sep 8 2022, 8:42 AM
Mogball added inline comments.
mlir/test/Dialect/Math/canonicalize.mlir
374

Fair enough

This revision is now accepted and ready to land.Sep 8 2022, 8:42 AM

nit: can you retitle the revision to "Add folder" instead of "canonicalizer"? This patch doesn't add a canonicalizer

Lewuathe updated this revision to Diff 458919.Sep 8 2022, 5:02 PM

Rebased on the latest main HEAD.

This revision was automatically updated to reflect the committed changes.