This is an archive of the discontinued LLVM Phabricator instance.

The fillOp's value needs to casted
ClosedPublic

Authored by pashu123 on Nov 4 2022, 10:15 AM.

Details

Summary

During elementwise fusion the fillOp's value was directly
referred without casting which can create mismatching dtypes.

Diff Detail

Event Timeline

pashu123 created this revision.Nov 4 2022, 10:15 AM
pashu123 requested review of this revision.Nov 4 2022, 10:15 AM
mravishankar requested changes to this revision.Nov 4 2022, 12:48 PM
mravishankar added inline comments.
mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
1730

Do you mind moving this into include/mlir/Dialect/Arith/Utils/Utils.h and implementation into lib/Dialect/Arith/Utils/Utils.cpp?

This revision now requires changes to proceed.Nov 4 2022, 12:48 PM
pashu123 updated this revision to Diff 473419.Nov 5 2022, 5:25 AM

Move the casting function to arith/utils.

pashu123 added inline comments.Nov 5 2022, 5:28 AM
mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
1730

Done, PTAL.

pashu123 marked an inline comment as done.Nov 5 2022, 5:28 AM
pashu123 updated this revision to Diff 473421.Nov 5 2022, 5:29 AM

fix typo.

mravishankar accepted this revision.Nov 6 2022, 6:12 PM

Thanks!

This revision is now accepted and ready to land.Nov 6 2022, 6:12 PM
ThomasRaoux requested changes to this revision.Nov 6 2022, 6:59 PM
ThomasRaoux added a subscriber: ThomasRaoux.
ThomasRaoux added inline comments.
mlir/lib/Dialect/Arith/Utils/Utils.cpp
83
This revision now requires changes to proceed.Nov 6 2022, 6:59 PM
ThomasRaoux added inline comments.Nov 6 2022, 7:03 PM
mlir/lib/Dialect/Arith/Utils/Utils.cpp
90

for linalg ops the type would be signless, therefore this is probably not the right way to decide between signed and unsigned cast

pashu123 updated this revision to Diff 474274.Nov 9 2022, 7:55 AM

Remove the cast duplicate function.

ThomasRaoux accepted this revision.Nov 9 2022, 8:02 AM

Thanks!

This revision is now accepted and ready to land.Nov 9 2022, 8:02 AM
This revision was automatically updated to reflect the committed changes.