This is an archive of the discontinued LLVM Phabricator instance.

[mlir][arith] Add expansion pattern for ext/trunc of bf16
ClosedPublic

Authored by rsuderman on Apr 4 2023, 5:08 PM.

Details

Summary

bf16 has a trivial truncation/extension behavior with F32 that
can be described in elementary arith operations. Include some
expansions to efficiently convert including rounding towards
infinity for f32 to bf16 truncation.

Diff Detail

Event Timeline

rsuderman created this revision.Apr 4 2023, 5:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2023, 5:08 PM
rsuderman requested review of this revision.Apr 4 2023, 5:08 PM
rsuderman edited the summary of this revision. (Show Details)Apr 4 2023, 5:09 PM
rsuderman added a reviewer: jpienaar.
rsuderman updated this revision to Diff 510995.Apr 4 2023, 9:55 PM

Added the missing test.

jpienaar accepted this revision.Apr 5 2023, 12:59 PM

Thanks for the tests and flag for testing pass!

This revision is now accepted and ready to land.Apr 5 2023, 12:59 PM