This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tosa] Fix tosa.cast UiToFp32 for tosa-to-linalg
ClosedPublic

Authored by rsuderman on Oct 13 2021, 7:22 PM.

Details

Summary

Part of the arith update broke UiToFp32. Fixed the lowering and included a new
test to detect a regression.

Diff Detail

Event Timeline

rsuderman created this revision.Oct 13 2021, 7:22 PM
rsuderman requested review of this revision.Oct 13 2021, 7:22 PM
GMNGeoffrey accepted this revision.Oct 14 2021, 11:18 AM
GMNGeoffrey added inline comments.
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
575

I wonder if for the future it would be better to do this with the type conversion part of the dialect conversion framework. Also man this is a huge function...

This revision is now accepted and ready to land.Oct 14 2021, 11:18 AM
rsuderman marked an inline comment as done.Oct 14 2021, 11:24 AM
rsuderman added inline comments.
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
575

In this case I am not certain the type conversion part would help that much. We actually need the signedness preserved after this executes and arguably other compilers may want to preserve it for their version. It would not be as bad if SIToFP and UIToFP operating signed/unsigned integers (not just signless).

But yeah, the function is a bit huge but it represents around 1/2 of all TOSA lowerings (all elementwise operations).

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