This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Arithmetic] Add constant folder for negf.
ClosedPublic

Authored by jacquesguan on Apr 7 2022, 2:27 AM.

Diff Detail

Event Timeline

jacquesguan created this revision.Apr 7 2022, 2:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 2:27 AM
jacquesguan requested review of this revision.Apr 7 2022, 2:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 2:27 AM
ftynse accepted this revision.Apr 7 2022, 5:04 AM

Do we expect folders for other unary operations or is the function template premature generalization?

mlir/include/mlir/Dialect/CommonFolders.h
79

Nit: I'd consider Calculation &&calculate here.

102

Nit: don't specify the explicit number of stack arguments in SmallVector unless you have a good reason to pick a specific number.

This revision is now accepted and ready to land.Apr 7 2022, 5:04 AM

address comment.

Do we expect folders for other unary operations or is the function template premature generalization?

I will try to create more cosntant folers for unary operatrions by this function template.

This revision was automatically updated to reflect the committed changes.